傳回或設定指定錯誤的數值。Number 是 Err 物件的預設特性。
語法
object.Number
引數:
Object: 必要。一律是 Err 物件
下列程式碼說明 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