Sets or clears a run-time error handler label.
If an error handler label is specified within this Action, then macro execution skips to this label within the macro whenever a run-time error occurs.
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 their 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.
If Label is left blank the error handler for the current macro is disabled. The error handler is automatically disabled when a macro is exited.
Label - (Required)
Name of the label within the macro to skip execution to when a run-time error occurs.
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
|
Action property | Description property | Line property | Macro property | Number property | Run-time errors | Err object | Resume action
© 2004-2021 looksoftware. All rights reserved.