#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Error handler

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Error handler

you must set error handler before error not after.

"linto" wrote in message
...
|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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet_change event handler error gen Excel Discussion (Misc queries) 0 January 18th 08 04:55 AM
Error Handler Question Jenny B. Excel Discussion (Misc queries) 4 January 9th 08 05:16 PM
Error Handler sharad Excel Discussion (Misc queries) 1 September 17th 07 06:38 PM
merge handler error with Briefcase JH Excel Discussion (Misc queries) 0 September 6th 05 02:52 AM
Error Handler Not Working Bill Excel Discussion (Misc queries) 0 August 25th 05 07:13 PM


All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"