相关疑难解决方法(0)

VBA错误处理的好模式

VBA中的错误处理有哪些好的模式?

特别是在这种情况下我应该怎么做:

... some code ...
... some code where an error might occur ...
... some code ...
... some other code where a different error might occur ...
... some other code ...
... some code that must always be run (like a finally block) ...
Run Code Online (Sandbox Code Playgroud)

我想处理这两个错误,并在可能发生错误的代码之后恢复执行.此外,最后的代码必须始终运行 - 无论先前抛出什么异常.我怎样才能达到这个目的?

vba exception-handling exception

71
推荐指数
6
解决办法
14万
查看次数

标签 统计

exception ×1

exception-handling ×1

vba ×1