Err Object

Contains information about run-time errors. Accepts the Raise and Clear methods for generating and clearing run-time errors.

Arguments:

Object: Required.Always the Err Object.

Remarks

The Err object is an intrinsic object with global scope — there is no need to create an instance of it in your code. The properties of the Err object are set by the generator of an error — Visual Basic, an Automation object, or the BSL programmer.

The default property of the Err object is Number.Err.Number contains an integer.

When a run-time error occurs, the properties of the "Err" object are filled with information that uniquely identifies the error and information that can be used to handle it. To generate a run-time error in your code, use the Raise method.

The Err object's properties are reset to zero or zero-length strings (" ") after an On Error Resume Next statement. The Clear method can be used to explicitly reset "Err".

The following example illustrates use of the Err object:

Example:

On Error Resume Next
Err.Raise 6   ' Raise an overflow error.
Err.Clear      ' Clear the error.