使用On Error Resume Next時,它會跳過遇到的錯誤並移至下一行。 如果我們使用err.Number和err.Description,它會顯示與錯誤相關的消息和編號。 我的問題是:如果它面臨的問題多於錯誤......那麼它將如何顯示?如果我們在使用錯誤恢復時遇到多個錯誤Next
On Error Resume Next
intDivideByZero
floatDivideByZero
If err.Number <> 0 Then
msgbox "the error number is : " & err.Number
msgbox "the error description is : " & err.Description
End If
On error Resume 0
這應該是'對錯誤轉到0'沒有'在錯誤恢復0 ',那會觸發你不期待的語法錯誤。 – Lankymart