dnickelson
Board Regular
- Joined
- Oct 30, 2003
- Messages
- 118
Is there a way to specify code to run if macro is exited, for instance, during a debug? I know it's kind of backwards, since the point of stopping execution is to stop execution, but wondering if there is a way to specify some cleanup code even if the rest of the code isn't working (something along the lines of 'on exit'.
In a certain case i use the status bar to display messages. If the code displays an error, or i'm stepping though it with F8 and stop execution, the status bar is left with it's current message. Also, of course, are other things like applications that don't get killed, etc.
I know an 'on error' routine would work for actually handling errors, and maybe I'm just completely avoiding reality by not using that exclusively, but i was looking more towards a quick 'always run thins code before exiting no matter what' kind of solution.
In a certain case i use the status bar to display messages. If the code displays an error, or i'm stepping though it with F8 and stop execution, the status bar is left with it's current message. Also, of course, are other things like applications that don't get killed, etc.
I know an 'on error' routine would work for actually handling errors, and maybe I'm just completely avoiding reality by not using that exclusively, but i was looking more towards a quick 'always run thins code before exiting no matter what' kind of solution.