A user-defined function for OpenOffice Calc
I’m trying to write a Basic function that could return the address of the currently selected cell.
If placed in a cell, the function should keep showing the address of the selected cell, refreshing it when I select a new one. It should behave like the information in the “Active cell reference” box, shown within standard OpenOffice toolbars, on the left side of the formula bar. Only in my case I need not only to see it but also manage it as a variable.
What I’ve written so far is the code below. It works but it keeps showing the coordinates of the same cell where I place the function.
REM ***** BASIC ***** Private Function getCellAddress() oActiveCell = ThisComponent.getCurrentSelection() oConv = ThisComponent.createInstance("com.sun.star.table.CellAddressConversion") oConv.Address = oActiveCell.getCellAddress getCellAddress = oConv.UserInterfaceRepresentation End Function
All suggestions will be appreciated