Error Statement |
Error [ errornumber ]
Any valid error code
Raises an error
The Error statement is included only for backward compatibility; instead, if you're using standard Visual Basic error handling, you should use the Err.Raise method and the Err object. Otherwise, you should use structured exception handling with the Try...Catch construct.
The Error statement has been a "compatibility" statement for several versions of Visual Basic. Interestingly, it managed to survive the general purge of outdated language elements. Despite its persistence, we still recommend that its use be strictly avoided.
Err.Raise Method, Try...Catch...Finally Statement