I have a static list of numbers (Vendor ID) and the job cycles through each number and opens a file (if present).
The problem is that the On Error only works the first time through the job. I can not use On Error Resume Next, because I have lines of code that if the file opens that need to be completed.
I can not use “if DIR(myfile) = “” then” because I am trying to lookup a file on the internet and DIR(“ & ActiveCell & “.xls”) is not working.
Sample CODE (as is):
Do Until ActiveCell = ""
On Error GoTo errhndler:
Workbooks.Open FileName:=" & ActiveCell.Offset(0, 1) & " " & ActiveCell & ".xls
The problem is that the On Error only works the first time through the job. I can not use On Error Resume Next, because I have lines of code that if the file opens that need to be completed.
I can not use “if DIR(myfile) = “” then” because I am trying to lookup a file on the internet and DIR(“ & ActiveCell & “.xls”) is not working.
Sample CODE (as is):
Do Until ActiveCell = ""
On Error GoTo errhndler:
Workbooks.Open FileName:=" & ActiveCell.Offset(0, 1) & " " & ActiveCell & ".xls