View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
RompStar RompStar is offline
external usenet poster
 
Posts: 29
Default trying to catch error 1004, don't work in 2nd loop...

So should I use Resume 1

or just resume ? because I would like it to resume at a specific
location, as it would try to execute the next line of code
and I want it to start at the top of the loop.

RompStar

On Apr 15, 4:56*pm, "Jim Rech" wrote:
Every error handler must have a Resume:

ErrHandler:

If Err.Number = 1004 Then
ActiveWorkbook.SaveAs StoreDir2 & "Store_" & ws.Name & endoffilename &
".xls"
ActiveWorkbook.Close True
GoTo 1 *''<<<<<<< Use Resume instead.
Else
MsgBox "The message text of the error is: " & Error(Err)
End If


End Sub