相关疑难解决方法(0)

'on error goto 0'和'on error goto -1'之间的区别 - VBA

任何人都可以在VBA中找到'On error goto -1'和'on error goto 0'之间的区别?我试过谷歌和msdn,但我没有运气.

excel msdn vba

40
推荐指数
2
解决办法
9万
查看次数

出错时转到0不重置错误捕获

我的印象是On Error GoTo 0重置错误处理.

那么为什么似乎On error resume next没有在以下注册?

Sub GetAction()
Dim WB As Workbook
Set WB = ThisWorkbook

On Error GoTo endbit:
'raise an error
Err.Raise 69
Exit Sub
endbit:
On Error GoTo 0 '<<<reset error handling?

On Error Resume Next
WB.Sheets("x").Columns("D:T").AutoFit
MsgBox "ignored error successfully and resumed next"    

End Sub
Run Code Online (Sandbox Code Playgroud)

error-handling excel vba excel-vba

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

excel ×2

vba ×2

error-handling ×1

excel-vba ×1

msdn ×1