OLEDBError.Number property (Excel)
Returns a numeric value that specifies an error. The error number corresponds to a unique trap number corresponding to an error condition that resulted after the most recent OLE DB query. Read-only Long.
Syntax
expression.Number
expression A variable that represents an OLEDBError object.
Example
This example displays the error number and other error information returned by the most recent OLE DB query.
Set objEr = Application.OLEDBErrors(1)
MsgBox "The following error occurred:" & _
objEr.Number & ", " & objEr.Native & ", " & _
objEr.ErrorString & " : " & objEr.SqlState
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.