Am Mittwoch, den 01.06.2005, 20:06 +0200 schrieb Ennio-Sr:
[...]
> >Sub create_delete_range
> >'----------------------
> >Dim oRange 'The created range
> >Dim oRanges ' All named ranges
> >Dim sName$ ' Name of the named range to create
> >Dim oActiveCell 'The current active cell
> 
> >oActiveCell = ThisComponent.CurrentSelection
> 
> >r$ = oActiveCell.celladdress.row+1
> >dim xcl$
> >xcl$ = "Sheet1.$F$"+r$     '[***]
> >print xcl$
> 
> >sName$ = "last_bal"
> >oRanges = ThisComponent.NamedRanges
> 
> >Dim oCellAddress As new com.sun.star.table.CellAddress
> >    oCellAddress.Sheet = 0 'The first sheet
> >oRanges.addNewByName(sName$,xcl$,oCellAddress,0)    
> 
> >oRange = ThisComponent.NamedRanges.getByName(sName$)
> >Print oRange.getReferredCells().getCellByPosition(0,0).getString()
> 
> >If oRanges.hasByName(sName$) Then
> >oRanges.getByName(sName$)
> >Print sName$
> >erase sName$

What are you trying to do here, delete the named range? Is "erase" a
function in your program?

oRanges.removeByName(sName$)

should do, see IDL-reference for "com.sun.star.sheet.XNamedRanges".

HTH,
Marc



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

Reply via email to