Number Method

Returns or sets a numeric value specifying an error. Number is the Err object's default property.

Syntax

object.Number

Arguments:

Object: Required. Always the Err object

The following code illustrates the use of the Number property.

Sub RaiseBuiltInError()
    On Error Resume Next       ' Enable error handling.
    Err.Raise 13               ' Raise a Type Mismatch error.
    Output = "Error # " & Err.Number & ": " & Err.Description
    Err.Clear                  ' Clear the error.
End Sub
'Output: Error # 13: Type mismatch