By mistake goto [label] does not work in VBA

In one of my Excel workbooks, I created a macro containing the following lines:

On Error GoTo saltaw Open fileout For Output As #iFileNumber 

However, if the fileout contains some invalid characters (for example, "\"), the macro stops and the "Runtime Error" 76: Path not found error window appears, as if the on error goto exist. The same, if you substitute on error goto on on error resume next . The macro stops on the next line. Why?

0
excel-vba error-handling
source share
1 answer

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

+2
source share

All Articles