1

For Error handling, I would like to have the current procedure name pushed into a call stack.

Is there any simple way to accomplish this outside of having to hard-code the name as a local variable for each subroutine?

0m3r
  • 12,286
  • 15
  • 35
  • 71
Ben C Wang
  • 617
  • 10
  • 19
  • 2
    look here http://stackoverflow.com/questions/3792134/get-name-of-current-vba-function – Fabrizio Jul 13 '15 at 07:07
  • 1
    Have a look at a third party plugin called `MZ-Tools` It's free as far as I can remember and you can set it up for all your modules to have a default error handling. This can include having the name of the module. Therefore when something goes wrong it will give you what you want (This is hard-coded, but the process of coding it is automated) – Tom Jul 13 '15 at 09:02

1 Answers1

1

Unfortunately, no. VBA code has no access to the call stack. A decent technique is here under Advanced Error Handling: https://www.fmsinc.com/tpapers/vbacode/Debug.asp

Excel Hero
  • 14,253
  • 4
  • 33
  • 40