问题
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