Resume Statement |
Resume Resume Next Resume label
Used to continue program execution when an error-handling routine is complete.
Statement | Description |
---|---|
Resume |
|
Resume Next |
|
Resume label |
|
You can only use the Resume statement in an error-handling routine; otherwise, a runtime error is generated.
An error-handling routine doesn't necessarily have to contain a Resume statement. If the error-handling routine is at the end of the procedure, and the result of the error handling would be to exit the procedure, you can simply allow the program to execute the End Sub or End Function statement. This has the effect of both resetting the Err object and exiting the procedure. This is shown in the following simple snippet:
Private Sub DoSomething() On Error GoTo DoSomething_Err ... DoSomething_Err: MsgBox Err.Description End Sub