Number

This property returns a numeric value specifying the VBA error number.

Group:  System Error

Syntax:  vError = SysErr.Number([vIndex])

vError   (Variant) is the VBA error number.

vIndex  (Long) Optional – is the error number to view. Note: this value is zero-based and defaults to 1.

Example:

Dim vError As Variant

vError = SysErr.Number(0)