Clearing an Error
When an error occurs, the Err object remains set with the error information until one of the following clears the error:
- Resume, Resume Next, or Resume <LineLabel>
- Exit Sub, Exit Function, or Exit Property
- End Sub, End Function, or End Property
- Any Goto statement
- Explicitly using the Clear method on the Err object
Until the error is somehow cleared, all the information remains set in the Err object. After the error is cleared, no information is found in the Err object.