Microsoft® Visual Basic® Scripting Edition
Number Property
 Language Reference 
Version 1 

See Also                     Applies to


Description
Returns or sets a numeric value specifying an error. Number is the Err object's default property.
Syntax
object.Number [= errornumber]

The Number property syntax has these parts:

Part Description
object Always the Err object.
errornumber An integer representing a VBScript error number or an SCODE error value.

Remarks
When returning a user-defined error from an Automation object, set Err.Number by adding the number you selected as an error code to the constant vbObjectError.

The following code illustrates the use of the Number property

On Error Resume Next
Err.Raise vbObjectError + 1, "SomeObject" ' Raise Object Error #1
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description)
Err.Clear    ' Clear the error.