On Error GoTo LineLabel
This statement lets you provide a custom error handler.
The LineLabel must be in the same procedure as the On Error statement.
You should always put this LineLabel at the end of the subroutine.
This section of code between the LineLabel and the End Sub is often referred to as the Error Handling Routine.
You should always include an Exit Sub, Exit Function or Exit Property before your error handling routine to ensure that it is only executed when an error occurs.
On Error GoTo ErrorHandler
You should always use a consistent line label for your error handling.
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext