Programming Reference Manual
 
Syntax
 
On Error GoTo 0
-or-
On Error GoTo label
-or-
On Error Resume Next
 
Description
Form 1: Disable the error handler (default).
 
Form 2: Send error conditions to an error handler.
 
Form 3: Error conditions continue execution at the next statement.
 
On Error sets or disables the error handler. Each user defined procedure has its own error handler. The default is to terminate the macro on any error. The Err object's properties are set whenever an error occurs. Once an error has occurred and the error handler is executing any further errors will terminate the macro, unless the Err object has been cleared.
 
Note: This instruction clears the Err and sets Error$ to null.
See Also
 
Example
 
Sub Main
On Error Resume Next
Err.Raise 1
Debug.Print "RESUMING, <span style='color: #004080; font-weight: bold;'>Err</span>=";Err
On Error GoTo X
Err.Raise 1
Exit Sub
 
X: Debug.Print "<span style='color: #004080; font-weight: bold;'>Err</span>=";Err
Err.Clear
Debug.Print "<span style='color: #004080; font-weight: bold;'>Err</span>=";Err
Resume Next
End Sub