J
John Hutcins
I have this code in a loop that saves a series of file to handle the error
created when the path doesn't exist. The first time a file throws an error
the GoTo Newpath exicutes correctly. When a second file produces the same
error it ignores the "On Error GoTo NewPath" statement and displays the 1004
Run Time Error message. If I hit debug and back the code up to the on error
statement it still fails. Any idea why On Error isn't working after the
initial hit?
Thanks,
John
On Error GoTo NewPath
Workbooks(Wcount + 1).SaveAs Filename:=vPath & "\" & SaveName, _
FileFormat:=xlNormal, PassWord:=vPassword, WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
NewPath:
If Err <> 0 Then
MsgBox ("No L drive path for " & vPath & " file " & SaveName & "
saved to 77xx")
Workbooks(Wcount + 1).SaveAs "L:\North America\77xx\" & SaveName
Err = 0
On Error GoTo 0
End If
created when the path doesn't exist. The first time a file throws an error
the GoTo Newpath exicutes correctly. When a second file produces the same
error it ignores the "On Error GoTo NewPath" statement and displays the 1004
Run Time Error message. If I hit debug and back the code up to the on error
statement it still fails. Any idea why On Error isn't working after the
initial hit?
Thanks,
John
On Error GoTo NewPath
Workbooks(Wcount + 1).SaveAs Filename:=vPath & "\" & SaveName, _
FileFormat:=xlNormal, PassWord:=vPassword, WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
NewPath:
If Err <> 0 Then
MsgBox ("No L drive path for " & vPath & " file " & SaveName & "
saved to 77xx")
Workbooks(Wcount + 1).SaveAs "L:\North America\77xx\" & SaveName
Err = 0
On Error GoTo 0
End If