C++
C#
VB
JScript
All

IDL Property IErr­Object.­Number


Property Number As Long

Returns or sets a numeric value representing an error.

Remarks

When Err.Number is 0, it means that no error has occurred. This means that testing whether Err.Number is not equal to zero can tell you whether an error has occurred.

Example

' This example shows Err.Number being used to test
' for errors when On Error Resume Next is being used.

On Error Resume Next

...

If Err.Number <> 0 Then
' Count the number of errors
ErrorCount = ErrorCount + 1
End If