Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an add-in, which provides certain user defined functions to xl.
However, an argument of some of these functions is a text string representing the name of a defined range in the "calling" workbook/worksheet", which does not get resolved correctly on recalcs of in-active workbooks/sheets. For this reason, it would be useful to be able to get information (in vba) on from which workbook and worksheet a function call is beeing made. Is this possible and if so how??? Bwetter programming (passing the range) could avoid this problem, but we're stuck with what we have a need the fix to be backwards compatible... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Function testUDF(a, b)
' udf in an addin Dim ws As Worksheet Dim wb As Workbook Dim sAddr$ With Application.Caller sAddr = .Address Set ws = .Parent Set wb = .Parent.Parent End With s = "[" & wb.Name & "]" & ws.Name & "!" & sAddr testUDF = s & " = " & a * b End Function It would of course be more efficient to pass the range object as you say. Regards, Peter T "Anders" wrote in message ... I have an add-in, which provides certain user defined functions to xl. However, an argument of some of these functions is a text string representing the name of a defined range in the "calling" workbook/worksheet", which does not get resolved correctly on recalcs of in-active workbooks/sheets. For this reason, it would be useful to be able to get information (in vba) on from which workbook and worksheet a function call is beeing made. Is this possible and if so how??? Bwetter programming (passing the range) could avoid this problem, but we're stuck with what we have a need the fix to be backwards compatible... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calling macros in another workbook | Excel Worksheet Functions | |||
Calling another workbook not working | Excel Worksheet Functions | |||
Reference code in another workbook from a calling workbook | Excel Programming | |||
What workbook is calling the function | Excel Programming | |||
calling sub from another workbook | Excel Programming |