Stephan Wunderlich schrieb:
Hi,

I'd like to know how the set the names of cells of spreadsheets through Java Program ?
eg.rename  the cell(A1) as "example"


you can't rename a Cell ... could it be that you want to add a named Range consisting of one Cell ?

something like

    Dim sBase As New com.sun.star.table.CellAddress

    oDoc = ThisComponent
    oNamedRanges = oDoc.getPropertyValue("NamedRanges")

Or, more simple in Basic
   oNamedRanges = oDoc.NamedRanges


    sBase.sheet = 0
    sBase.Column = 0
    sBase.Row = 0

    oNamedRanges.addNewByName("MyRange", "A1:B3", sBase, 0)

This will not work, because it will create a relative address depending on the position where the named range is used. Try this:

  oNamedRanges.addNewByName("MyRange", "$A$1", sBase, 0)

Note the dollar signs, they will create an absolute reference to cell A1.

Regards
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to