* Ennio-Sr <[EMAIL PROTECTED]> [300505, 01:02]:
> * Ennio-Sr <[EMAIL PROTECTED]> [290505, 17:10]:
> > 
> > * Andrew Douglas Pitonyak <[EMAIL PROTECTED]> [280505, 18:56]:
> > > 
> > > [skip]
> > > 
> > > *REM I could obtain the cell address by obtaining the cell*
> > > 
> > > *REM and then extracting the address from the cell.*
> > 
> > This is exactly what I need.
> > How can I extract the cell address after the cursor has been positioned onto
> > a cell?
> > 
> > > [...] 
> > 
> 
> I went on trying, after I read section 6.5 of your Macro Info doc. but
> having no idea of what all those command precisely mean, I'm still far
> from my goal ;(
> May be you could help me better looking at what I wrote:
> [skip] 

My last efforts brought me to a point where the cell I need is shown in
a small box: however no named range ('last_bal') is created ;(

This are the lines of the relevant code:

rem ##################################
-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
-Dim oConv ' The Cell address conversion service
-oRanges2 = ThisComponent.createInstance("com.sun.star.sheet.SheetCellRanges")
-ThisComponent.CurrentController.Select(oRanges2)
-oActiveCell = ThisComponent.CurrentSelection
-oConv = 
ThisComponent.createInstance("com.sun.star.table.CellAddressConversion")
-oConv.Address = oActiveCell.getCellAddress
-Print oConv.UserInterfaceRepresentation
-xCell =  oConv.PersistentRepresentation
-sName$ = "last_bal"
-oRanges = ThisComponent.NamedRanges
-If NOT oRanges.hasByName(sName$) Then
-Dim oCellAddress As new com.sun.star.table.CellAddress
-    oCellAddress.Sheet = 0 'The first sheet
-oRanges.addNewByName(sName$,oConv,oCellAddress,0)    
                             ^^^^^ [*]
rem oRanges.addNewByName(sName$,"$Sheet1.$F$15",oCellAddress,0)
-End If
-oRange = ThisComponent.NamedRanges.getByName(sName$)
rem Print oRange.getReferredCells().getCellByPosition(0,0).getString()
rem ###################################

[*] I tried with xCell to no avail: what should I put there?

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]

Reply via email to