Description Method

Returns a descriptive string associated with an error.

Syntax

object.Description

Arguments:

Object: Always the Err object.

Remarks

The Description property consists of a short description of the error. If Description isn't filled in, and the value of Number corresponds to a BSL run-time error, the descriptive string associated with the error is returned.

The following example illustrates the use of the description method:

Example 1:

Sub RaiseOverflowError()
    On Error Resume Next          ' Enable error handling.
    Err.Raise 6                   ' Raise an overflow error.
    Output = "Error # " & Err.Number & ": " & Err.Description
    Err.Clear                     ' Clear the error.
End Sub
'Output: Error # 6: Overflow

Example 2:

Sub RaiseMultipleErrors()
    On Error Resume Next          ' Enable error handling.
    ' Raise a "Type Mismatch" error.
    Err.Raise 13
    Output1 = "Error # " & Err.Number & ": " & Err.Description

    Err.Clear                     ' Clear the error.
    ' Raise a "Division by Zero" error.
    Err.Raise 11
    Output2 = "Error # " & Err.Number & ": " & Err.Description

    Err.Clear                     ' Clear the error.
End Sub
'Output1: Error # 13: Type mismatch 
'Output2: Error # 11: Division by zero