Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Determining whether function called by Excel or VBA

Another one I cannot seem to figure out..

I'm trying to determine within a function whether it has
been called directly from Excel or from another VBA
sub/function. I've tried looking for ways to access the
call stack, but have had no luck.

Does anybody have any clues on this one?

Thanks in advance,
Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Determining whether function called by Excel or VBA

Tried that one too. Unfortunately, it returns information
about where VBA was ultimately called from and, since all
my functions are ultimately called from Excel, that
doesn't work. That is, unless there's more to the Caller
property than I'm seeing.

Any other ideas?

-----Original Message-----
Checkout the Caller property.

Alan Beban

Ryan Poth wrote:
Another one I cannot seem to figure out..

I'm trying to determine within a function whether it

has
been called directly from Excel or from another VBA
sub/function. I've tried looking for ways to access the
call stack, but have had no luck.

Does anybody have any clues on this one?

Thanks in advance,
Ryan


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Determining whether function called by Excel or VBA

I guess I don't know what you mean by "called directly from Excel or
from another VBA sub/function." Perhaps you could provide a brief
illustration of each, and what you are trying to learn.

Alan Beban

Ryan Poth wrote:
Tried that one too. Unfortunately, it returns information
about where VBA was ultimately called from and, since all
my functions are ultimately called from Excel, that
doesn't work. That is, unless there's more to the Caller
property than I'm seeing.

Any other ideas?


-----Original Message-----
Checkout the Caller property.

Alan Beban

Ryan Poth wrote:

Another one I cannot seem to figure out..

I'm trying to determine within a function whether it


has

been called directly from Excel or from another VBA
sub/function. I've tried looking for ways to access the
call stack, but have had no luck.

Does anybody have any clues on this one?

Thanks in advance,
Ryan


.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Determining whether function called by Excel or VBA

Called from a cell (worksheet function)??

If TypeOf Application.Caller Is Range Then
'it's from a UDF in a cell
Else
'it's not from a UDF in a cell
End If

Ryan Poth wrote:

Tried that one too. Unfortunately, it returns information
about where VBA was ultimately called from and, since all
my functions are ultimately called from Excel, that
doesn't work. That is, unless there's more to the Caller
property than I'm seeing.

Any other ideas?

-----Original Message-----
Checkout the Caller property.

Alan Beban

Ryan Poth wrote:
Another one I cannot seem to figure out..

I'm trying to determine within a function whether it

has
been called directly from Excel or from another VBA
sub/function. I've tried looking for ways to access the
call stack, but have had no luck.

Does anybody have any clues on this one?

Thanks in advance,
Ryan


.


--

Dave Peterson

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
How do I know which cell a function is called from? Murami Excel Worksheet Functions 3 November 24th 06 02:22 PM
What is this function called?? jPaulB Excel Discussion (Misc queries) 3 August 4th 06 08:33 PM
Function, dont know what its called Michael Excel Worksheet Functions 1 May 8th 06 09:47 PM
Idea for an Excel function called "Spread" Kerry Excel Worksheet Functions 0 May 2nd 05 09:52 PM
mystery function called 'TABLE' SongBear Excel Worksheet Functions 7 January 7th 05 04:56 AM


All times are GMT +1. The time now is 05:41 AM.

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

About Us

"It's about Microsoft Excel"