Thread: Error Handling
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Burnnie Holliday Burnnie Holliday is offline
external usenet poster
 
Posts: 17
Default Error Handling


I have a problem with the following subroutine. The files that it opens are
located in one of two locations, and it accomplishes this regardless of what
folder the file is located in. The problem is that it pauses execution
everytime any line in that particular subroutine gets run. What's more
confusing is that before, it worked perfectly, and seemingly without any
changes, suddenly this bug cropped up.

Sub OpenMatFile(FileName As String)

On Error Resume Next

Workbooks.Open MatPath & FileName, UpdateLinks:=False, ReadOnly:=True

If Err.Number < 0 Then
Workbooks.Open MatPath & "2009 Material Archives\" & FileName,
UpdateLinks:=False, ReadOnly:=True
End If

End Sub

--
Burnnie Holliday