C.
PS: In Excel / VBA this can be achived by
Code: Select all
Application.Caller
Code: Select all
Application.Caller
I don't see why that implies that I cannot get the callers address. For example, there are functions like ROW() which return the row index of the calling cell. Or you can get the currently active sheet withVilleroy wrote:No way. Spreadsheet functions calculate nothing but cell values.
http://api.openoffice.org/docs/common/r ... AddIn.html
Code: Select all
Function Test
Test = ThisComponent.CurrentController.ActiveSheet.Name
End Function
Code: Select all
Function Tester(arg1, arg2)
On Error GoTo EH
Tester = arg1^0.5
exit function
EH:
Print "This cell caused an error: " & arg2
End function
Code: Select all
=TESTER(D3; CELL("ADDRESS";B5))
But ROW() gets you the row of the calling cell - so there IS an implementation the makes use of some way to get the callers address. Note that I do not need to rely on Basic. It would be sufficient to implement some UNO Java stuff.Villeroy wrote:There is nothing like Application.caller and the documentation proves my point.
Code: Select all
Function ViewData
ViewData = ThisComponent.CurrentController.viewData
End Function
If you use ROW() without argument you get the ROW() of the cell that called the function. Just try it.FJCC wrote:The example of ROW() is not relevant, I think, because ROW() requires an argument.
Code: Select all
Function trigger(a(),s,r,c)
ThisCell= getSheetCell(s,r,c)
msgbox "something in the referenced range of "& ThisCell.AbsoluteName &" did happen"
End Function
Code: Select all
Option VBASupport 1
Function UDF(Arg1, Arg2, Optional Caller)
If Not IsMissing(Caller) Then
sCallerName = Caller.CellRange.AbsoluteName
Print sCallerName
End If
End Function
Seems to work with LibreOffice since version 7.eeigor wrote:Use Excel VBA Range. Just referring to itself. And without quotes.