I don't think that this can be done, but I am just checking.
In Excel VBA at the end of my macros that create a report worksheet, I would like to create a subroutine in VBA the adds a "signature" to the bottom of the report worksheet. I would like to include the name of the calling macro in the signature. Obviously, I can just pass this name as an input parameter, but I was wondering if there was a way to get the name in code. This would also be useful to use in error messages.
Get the Name of the Calling Procedure
-
- Administrator
- Posts: 78574
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Get the Name of the Calling Procedure
As far as I know, there is no way to do that except explicitly passing the name.
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 93
- Joined: 04 Mar 2010, 16:32
Re: Get the Name of the Calling Procedure
Thanks, Hans, just wanted to check!
-
- 5StarLounger
- Posts: 1102
- Joined: 21 Jan 2011, 16:51
- Location: Florida
Re: Get the Name of the Calling Procedure
So there is no way to access the Call Stack programmatically?
PJ in (usually sunny) FL
-
- Administrator
- Posts: 78574
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Get the Name of the Calling Procedure
No, there isn't. But you can create your own call stack: Managing a programmatically accessible stack trace.
Best wishes,
Hans
Hans