PC Review


Reply
Thread Tools Rate Thread

Application.Caller Problems

 
 
=?Utf-8?B?TWF0dGhldyBQZmx1Z2Vy?=
Guest
Posts: n/a
 
      26th Sep 2007
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      26th Sep 2007
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" <(E-Mail Removed)> wrote in
message news:0C167F40-4FC5-4782-A3F7-(E-Mail Removed)...
> 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 With Quote
 
=?Utf-8?B?TWF0dGhldyBQZmx1Z2Vy?=
Guest
Posts: n/a
 
      26th Sep 2007
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

 
Reply With Quote
 
=?Utf-8?B?TWF0dGhldyBQZmx1Z2Vy?=
Guest
Posts: n/a
 
      26th Sep 2007
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" <(E-Mail Removed)> wrote in
> message news:0C167F40-4FC5-4782-A3F7-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
DDE and Application.Caller dmitrijs Microsoft Excel Programming 0 18th Oct 2007 11:30 AM
application caller =?Utf-8?B?UmljaA==?= Microsoft Excel Programming 1 21st Sep 2006 07:48 PM
Application.Caller Mark Worthington Microsoft Excel Programming 9 12th Feb 2004 07:32 PM
application.caller Jase Microsoft Excel Programming 0 6th Jan 2004 03:51 AM
Re: DDE and application.caller help Ross Kaminsky Microsoft Excel Programming 1 17th Jul 2003 04:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:44 AM.