Metodo Number

Restituisce o imposta un valore numerico che specifica un errore. Number è la proprietà predefinita dell'oggetto Err.

Sintassi

object.Number

Argomenti:

Object: obbligatorio. Sempre l'oggetto Err.

Nel codice seguente viene illustrato l'uso della proprietà Number.

Sub RaiseBuiltInError()
    On Error Resume Next       ' Enable error handling.
    Err.Raise 13               ' Raise a Type Mismatch error.
    Output = "Error # " & Err.Number & ": " & Err.Description
    Err.Clear                  ' Clear the error.
End Sub
'Output: Error # 13: Type mismatch