Reputation: 6950
How to get the currently executed macro name in Excel VBA?
Sub WhateverMacroName()
MsgBox (GetTheNameOfCurrentlyExecutedMacro)
End Sub
Which should return WhateverMacroName
Upvotes: 0
Views: 1925
Reputation: 96771
That which is not exposed must be remembered.
Define a Global variable and have each Sub setup the variable at entry. Thus a general error handler can determine a miscreant.
If you have a nested call structure (with subs calling subs), you will need to implement a stack.
Upvotes: 4