On Error Statement
On Error GoTo label
|0|-1 Syntax 1.
On Error Resume Next Syntax 2.
label
Either label
, 0
, or -1
is requiredA valid label within the subroutine
Enables or disables error handling within a procedure.
If you don’t use an On
Error
statement or a
Try...Catch
block in your procedure, or if you
have explicitly switched off error handling, the Visual Basic runtime
engine will automatically handle the error. First, it will display a
dialog box containing the standard text of the error message. Second,
it will terminate the application. So any error that occurs in the
procedure will produce a fatal runtime error.