Benzadeus
07-27-2009, 05:18 AM
Hi,
I'd like to know if there is a function that returns the name of the procedure that invoked another one.
Let's suppose I run the code below from mdlCaller:
Sub mdlCaller()
Call mdlTest
End Sub
Sub mdlTest()
Dim sCaller As String
'Help needed here
sCaller = 'Code that returns "mdlCaller"
Debug.Print "This procedure was called by the procedure " & sCaller
End Sub
The only way I can do this is
Sub mdlCaller()
Call mdlTest("mdlCaller")
End Sub
Sub mdlTest(sCaller As String)
Debug.Print "This procedure was called by the procedure " & sCaller
End Sub
, but I don't want to pass arguments.
Is it possible?
I'd like to know if there is a function that returns the name of the procedure that invoked another one.
Let's suppose I run the code below from mdlCaller:
Sub mdlCaller()
Call mdlTest
End Sub
Sub mdlTest()
Dim sCaller As String
'Help needed here
sCaller = 'Code that returns "mdlCaller"
Debug.Print "This procedure was called by the procedure " & sCaller
End Sub
The only way I can do this is
Sub mdlCaller()
Call mdlTest("mdlCaller")
End Sub
Sub mdlTest(sCaller As String)
Debug.Print "This procedure was called by the procedure " & sCaller
End Sub
, but I don't want to pass arguments.
Is it possible?