MyFunction.Name / MyFunction.Caller

A

Alexander

Is there a possibility in VBA to get the Name of the Function were my code
is running and the Name of the Function who called my function

Example:
'-------------------------------------------------
Dim MyFunctionName
Dim MyFunctionCallerName

Function Step1 ()
Step2 ()
EndFunction

Function Step2 ()
MyFunctionName = GetFunctionInfo.Name
MyFunctionCallerName = GetFunctionInfo.Caller
EndFunction
'-----------------------------------------------

As a Result I would like to have:
MyFunctionName = "Step2"
MyFunctionCallerName = "Step1"

This works in JavaScript.
Does there exist something similar in VBA?

Thanks
Alexander
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top