The On Error Resume Next statement tells VBScript to resume program execution on the line immediately following the one where the error occurred. Without this, the program would just crash.
If an error occurs on any line following this statement, then VBScript will continue with the next program statement.
When a runtime error occurs, information about the error is stored in the VBScript Err object. You can use this information in conjunction with the On Error Resume Next statement to handle error conditions intelligently.
In this example, error handler code is passed information about the error.
This function is called when the Err object's number property does not equal zero, which indicates an error. This example simply displays information about the error.
You can write much more sophisticated code to take some action, depending on the error.