【发布时间】:2020-03-28 10:47:35
【问题描述】:
我尝试在 VBA 代码中使用多个错误处理
Sub ErrorTestMultiple()
Test1:
On Error GoTo ErrHandler1
y = 6 / 0
GoTo Test2
ErrHandler1:
Cells(4, "H") = "Test 1 failed"
Cells(4, "I") = Err.Description
Test2:
On Error GoTo ErrHandler2
y = 6 / 0 ' Process stop here - Why is the 2nd Error handler not working?
GoTo Test3
ErrHandler2:
Cells(5, "H") = "Test 2 failed"
Cells(5, "I") = Err.Description
Test3:
End Sub
我尝试在here 中添加以下示例的简历,但没有成功
我怎样才能让它工作?
【问题讨论】:
标签: vba