on error goto [label] not working in VBA

社会主义新天地 提交于 2019-12-11 16:28:41

问题


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

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?


回答1:


Go to Tools -> Options -> General and set Error Trapping to something else that better suits you.



来源:https://stackoverflow.com/questions/4112860/on-error-goto-label-not-working-in-vba

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!