Microsoft Office 2000/Visual Basic Programmer's Guide |
When an error occurs, VBA uses the Err object to store information about that error. The Err object can only contain information about one error at a time. Each time an error occurs, any existing information in the Err object is replaced with information about the new error.
The properties of the Err object contain information such as the error number, description, and source. The Err object's Raise method is used to generate errors, and its Clear method is used to remove any existing error information.
To see a variety of examples that illustrate how to use the VBA Err object, use the F8 key to step through the code in the CallErrorExamples procedure, available in the modErrorCode module in ErrorHandlers.dot in the ODETools\V9\Samples\OPG\Samples\CH08 subfolder on the Office 2000 Developer CD-ROM.
For more information about the VBA Err object, search the Visual Basic for Applications Reference Help index for "Err object."