Hi all!
Having some problems with named ranges in a multiplesheet environment ;(
The offending code seems to be the following instruction:
------------
Dim oCellAddress As new com.sun.star.table.CellAddress
oCellAddress.Sheet = Sheet_x ' -->>>>> It was 0 <<<<<<-- ' The first sheet
oRanges.addNewByName(sName$,xcl$,oCellAddress,Sheet_x) ' --->>> was 0)
'AT THIS POINT THE RANGE IS CREATED AS SH_TWO.$J$72 ?!!!!!!!!!!!!!!!
' We arrange for copying the formula from last used row to the next one
dispatcher.executeDispatch(oDoc, ".uno:Copy", "", Sheet_x, Args1())
------------
Say I'm on Sh_one when I execute the macro: the "Sheet_x" parameter is
="Sh_one" and "xcl$" carries the correct value of the cell which is being
'named'; all relevant values (as seen running the macro by step)
maintain their correct values: however, if soon after the range name is created
by the above reported piece of code I examine the sheets, the created
range name appears as belonging to another sheet, not to the one carried by
"Sheet_x" parameter.
In other words, it seems impossible to keep the named ranges sticking to
the sheet in which they are apparently created.
Do you have any suggestions? May be that code is someway bugged
(although the full macro works correctly with single sheet
spreadsheets!).
Thanks for your attention.
Regards,
Ennio
--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo. \\?//
Fa' qualche cosa di cui non sei capace!" (diceva Henry Miller) ] (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that. )=(
Do something you aren't good at!" (as Henry Miller used to say) ]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]