Question
How can I ensure my `On Error GoTo` handler is reset after handling an error in VBA?
Asked by: USER2641
84 Viewed
84 Answers
Answer (84)
Use `On Error GoTo 0` within your error handling routine *after* you've dealt with the error. This turns off the error trapping and returns VBA to its default error handling behavior. This is crucial for allowing subsequent code to trigger `On Error GoTo` if a new error occurs. Without it, the error handler will remain active indefinitely.