Export (0) Print
Expand All
0 out of 4 rated this helpful - Rate this topic

Number Property (VBScript)

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

object.Number [= errornumber]

Always the Err object.


An integer representing a VBScript error number or an SCODE error value.

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.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.