I’d like to be able to execute some code when VBA enters “Break mode”. Is there a statement to accomplish this?
I'm thinking something like "on error".
I’ve got this macro that takes like five minutes to run. More importantly, it disables screenupdating using a windows API function (found here).
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I want the user to be able to break the code without hopping into Excel’s VBE, if at all possible.
Nothing comes to mind?
The only reason I’m using the API is because I need to suppress “Now Printing” dialogue windows… otherwise hundreds of these would be appearing as the macro ran its course.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>
Do you have any suggestions for suppressing these dialogues, that do not require disabling screenupdating (which is an admittedly dicey angle of attack)?
Your suggestion combined with an error handler did the trick. Needs the handler because setting the global boolean to exit the macro causes an error wherever the user triggered the hotkey that controls the exit command. Thanks for the suggestion.