Error handler

L

linto

I used the following code to open a file.
2 users at 2 different sites have different path to the same excel file.
i used an error handler to overcome this. but it seems not working
a run time error 1004 appears when it tries to open the file from the first
path and in fact the correct path is the secon one

Workbooks.Open FileName:= _
"I:\_Other_Site\DIESE HARNESS OFFSHORING\00 HARNESS DESIGN
ROUTING\02 Work Request Generator\Harness Routing WR template vE.xls" _
, UpdateLinks:=0
On Error Resume Next
Workbooks.Open FileName:= _
"I:\_My_Site\DIESE HARNESS OFFSHORING\00 HARNESS DESIGN ROUTING\02
Work Request Generator\Harness Routing WR template vE.xls" _
, UpdateLinks:=0
On Error Resume Next
 
H

Homey

you must set error handler before error not after.

|I used the following code to open a file.
| 2 users at 2 different sites have different path to the same excel file.
| i used an error handler to overcome this. but it seems not working
| a run time error 1004 appears when it tries to open the file from the
first
| path and in fact the correct path is the secon one
|
| Workbooks.Open FileName:= _
| "I:\_Other_Site\DIESE HARNESS OFFSHORING\00 HARNESS DESIGN
| ROUTING\02 Work Request Generator\Harness Routing WR template vE.xls" _
| , UpdateLinks:=0
| On Error Resume Next
| Workbooks.Open FileName:= _
| "I:\_My_Site\DIESE HARNESS OFFSHORING\00 HARNESS DESIGN ROUTING\02
| Work Request Generator\Harness Routing WR template vE.xls" _
| , UpdateLinks:=0
| On Error Resume Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top