Description Property (Visual Basic)

Applies To

Err Object.

Description

Returns or sets a descriptive string associated with an error.

Syntax

object.Description [= stringexpression]

The Description property syntax has these parts:

Part Description
object Always the Err object.
stringexpression A string expression containing a description of the error.


Remarks

The Description property comprises a short description of the error. Use this property to alert the user to an error that you cannot or do not want to handle. When generating a user-defined error, assign a short description of your error to this property. If Description is not filled in, and the value of Number corresponds to a Visual Basic run-time error, the string returned by the Error function is placed in Description when the error is generated.

See Also

Err Object, Error Function, HelpContext Property (Visual Basic), HelpFile Property (Visual Basic), LastDLLError Property, Number Property, Source Property.

Example

This example assigns a user-defined message to the Description property of the Err object.


Err.Description = "It was not possible to access an object necessary " _
    & "for this operation."