Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to use Application.Caller to determine if VBA or a cell has called
my UDF. However, when called from the worksheet in a particular UDF, Application.Caller = -1711800260 and its TypeName is Double. However, when I send Application.Caller to an IsRange function, it is passed as a valid range. When I type in the Immediate window Application.Caller.Columns.Count, it returns the 'Object Required' error. I don't understand it. Has anyone else had this problem/ Thanks, Matthew Pfluger |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe
If IsError(Application.Caller) Then MsgBox "VBA" Else MsgBox "Excel" End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Matthew Pfluger" wrote in message ... I'm trying to use Application.Caller to determine if VBA or a cell has called my UDF. However, when called from the worksheet in a particular UDF, Application.Caller = -1711800260 and its TypeName is Double. However, when I send Application.Caller to an IsRange function, it is passed as a valid range. When I type in the Immediate window Application.Caller.Columns.Count, it returns the 'Object Required' error. I don't understand it. Has anyone else had this problem/ Thanks, Matthew Pfluger |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Instead of lots of testing and research, I used this workaround:
Dim vCaller as variant Set vCaller = Application.Caller if TypeName(vCaller) = "Range" then ' code end if However, this doesn't tell me if a function has called a function (has called a function). I will elaborate in another post since this is a new issue. Matthew Pfluger "Matthew Pfluger" wrote: I'm trying to use Application.Caller to determine if VBA or a cell has called my UDF. However, when called from the worksheet in a particular UDF, Application.Caller = -1711800260 and its TypeName is Double. However, when I send Application.Caller to an IsRange function, it is passed as a valid range. When I type in the Immediate window Application.Caller.Columns.Count, it returns the 'Object Required' error. I don't understand it. Has anyone else had this problem/ Thanks, Matthew Pfluger |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The problem is that Application.Caller is not an error, it is a double value
(unless it is assigned to another variable; see my other post in this thread). Matthew Pfluger "Bob Phillips" wrote: Maybe If IsError(Application.Caller) Then MsgBox "VBA" Else MsgBox "Excel" End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Matthew Pfluger" wrote in message ... I'm trying to use Application.Caller to determine if VBA or a cell has called my UDF. However, when called from the worksheet in a particular UDF, Application.Caller = -1711800260 and its TypeName is Double. However, when I send Application.Caller to an IsRange function, it is passed as a valid range. When I type in the Immediate window Application.Caller.Columns.Count, it returns the 'Object Required' error. I don't understand it. Has anyone else had this problem/ Thanks, Matthew Pfluger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
application.caller | Excel Programming | |||
application caller | Excel Programming | |||
Row = Application.Caller.Row | Excel Worksheet Functions | |||
Application.Caller | Excel Programming | |||
Application.caller | Excel Programming |