![]() (NOTE that On Error Goto 0 is different from the above)Īlso important to note is that Err.Clear resets it to zero but it is actually equivalent to: On Error Goto -1 On Error Goto -1 ' Which I think is less clear! You can stop a procedure being in the "I'm handling an error" state by clearing the exception (setting err to nothing so the err.number property becomes 0) by using Err.clear When it is in this state, if another "On Error Goto" label2 statement is executed it will NOT goto label2, but raises and error which is passed to the code that called the procedure. When you use on error goto Label1 the procedure enters into a state of "I'm handling an error" as an exception has been raised. (It works but I'm interested to know what other people make of it and for any suggestions you might like to make.) ![]() ![]() ![]() The code below is pretty self explanatory: just copy and paste it all into a module and run it, it provides a few use cases and many explanatory comments in the text.
0 Comments
Leave a Reply. |