Show Contents / Index / Search

Resuming a Procedure After an Error

After your macro successfully traps and handles an error, you can choose whether to have the macro exit the procedure (by including an Exit Sub or Exit Function statement in the handler) or resume the procedure (by including a resume statement). When you resume a procedure, you can also have the macro correct the error condition automatically, in which case the end user may never know that an error occurred.

Use this statement

To do this


Exit the error handler and resume the macro at the line that caused the error. Your macro must automatically correct the error condition or prompt the user to correct it before resuming; otherwise, the error will occur again.

Resume Next

Resume the macro at the line following the one that caused the error.

Resume Label

Exit the error handler and pass control to the statement identified by the label.