问题描述
在我的一本Excel工作簿中,我创建了一个包含以下几行的宏:
In one of my Excel workbooks I have created a macro containing the following lines:
On Error GoTo saltaw
Open fileout For Output As #iFileNumber
但是,当fileout
包含一些无效的字符(例如,"\")时,宏停止,并且出现错误窗口运行时错误'76':找不到路径",就像on error goto
行未出现一样存在.如果将on error goto
替换为on error resume next
,则相同.宏在下一行停止.为什么?
However, when fileout
contains some invalid chars ("\", for example) the macro stops and the error window "Runtime error '76': Path not found" appears, as if the on error goto
line does not exist. Same if I substitute on error goto
by on error resume next
. The macro stops at the following line. Why?
推荐答案
转到Tools -> Options -> General
并将Error Trapping
设置为更适合您的其他内容.
Go to Tools -> Options -> General
and set Error Trapping
to something else that better suits you.
这篇关于错误时转到[标签]在VBA中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!