【发布时间】:2016-08-31 12:54:35
【问题描述】:
我只想捕获我的错误处理语句一次,如果它再次失败,则继续下一个。我不确定如何实现这一目标,但到目前为止,如果代码继续失败,我可以重新运行代码。原因是如果文件永远不存在,我不想陷入循环。这是我所拥有的:
....some code
TryAgain:
....
....
If Not FileExists("C:\" & FileName) Then
GoTo TryAgain >>> Only want to run this once if it fails again continue on down with the next section of codes.
End If
....next code stuff....
【问题讨论】:
-
goto 是撒旦的产物。改用 porper 循环。
标签: vba error-handling