Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Application.Caller Problems

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Application.Caller Problems

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Application.Caller Problems

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Application.Caller Problems

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
application.caller Alexander Excel Programming 3 December 8th 06 11:18 PM
application caller Rich Excel Programming 1 September 21st 06 07:48 PM
Row = Application.Caller.Row Charles Woll Excel Worksheet Functions 8 February 28th 05 02:04 PM
Application.Caller Mark Worthington Excel Programming 9 February 12th 04 07:32 PM
Application.caller Clark B Excel Programming 2 July 29th 03 11:17 PM


All times are GMT +1. The time now is 09:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"