Resumes macro execution after a run-time error handler is finished.
If a label is specified within this action, then macro execution resumes at the specified label within the macro. If Next is specified then execution will resume with the line immediately following the statement that caused the error.
Error-handling routines rely on the value in the Number property of the Err object to determine the cause of the error. The error-handling routine should test or save relevant property values in the Err object before any other errors can occur or before a procedure that might cause an error is called. The property values in the Err object reflect only the most recent error. The error message associated with the error is contained in the Description property of the Err object.
If you don't use an OnError action in your macro, any run-time error that occurs is fatal; that is, an error message is displayed and macro execution stops.
An "enabled" error handler is one that is turned on by an OnError action; an "active" error handler is an enabled handler that is in the process of handling an error. If an error occurs while an error handler is active, the current macro's error handler can't handle the error. If a calling macro has an enabled error handler, it is activated to handle the error. If the calling macro's error handler is also active, control passes back through previous calling macros until an enabled, inactive, error handler is found. If no inactive, enabled error handler is found, or there is no calling macro, the error is fatal at the point at which it actually occurred. Each time the error handler passes control back to a calling macro, that procedure becomes the current macro. Once an error is handled by an error handler in any macro, execution resumes in the current macro at the point designated by the Resume action.
Label - (Required)
The label at which macro execution should be resumed.
The Label argument may be set to "Next", in which case the following special processing occurs: If the error occurred in the same macro as the error handler, execution resumes with the line immediately following the statement that caused the error. If the error occurred in a called macro, execution resumes with the line immediately following the line that last called out of the macro containing the error-handling routine.
The following macro will catch any runtime error, handle it according to its number and store a description of the error in a variable. MACRO EDITOR
|
Err object | OnError action | Run-time Errors
© 2004-2021 looksoftware. All rights reserved.