Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In writing a macro, I've read that it's good programming practice to clean
up after the macro is run, by that I mean resetting application.screenupdating, calculation modes to their original states, that sort of thing. Now in the case of there being some code for error handling, that code is typically placed at the end of the macro: Sub xxx() main code If error then goto Error_handler clean up code Exit sub Error_handler: code Exit sub End sub There's a chance that after handling the error, the macro may be exited without there being any cleanup. I suppose one can repeat the cleanup code in the error handler. However, if there are more than a few errorhandlers to deal with different types of errors, it would be clumsy to repeat the same cleanup code again and again. How should this problem be dealt with? TIA. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error Handling | Excel Discussion (Misc queries) | |||
Handling #NUM! error | Excel Worksheet Functions | |||
Error Handling | Excel Programming | |||
Error handling | Excel Programming | |||
Error Handling | Excel Programming |