Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Trapping Workbook OPEN errors

I am having trouble isolating the various error types when
opening workbooks. I wrap the code in ON error stuff,
then open, then check the error. Whether the file exists,
or does NOT exist, the err is 1004. I see elsewhere there
is reference to Error( ) where 53 is one of them and 55 is
the other, but I cannot seem to figure out how to check
these. Right now, I am using the first 5 chars of the
error DESCR and it works, but I don't like that approach.
Help please! ; -)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Trapping Workbook OPEN errors

Why not use the Dir function before you attempt to open the file and if it
returns empty you know the file is not there.

msgbox dir("c:\windows\win.ini") returns win.ini as a string and nothing if
the file doesn't exist.

Robin Hammond
www.enhanceddatasystems.com

"sclark" wrote in message
...
I am having trouble isolating the various error types when
opening workbooks. I wrap the code in ON error stuff,
then open, then check the error. Whether the file exists,
or does NOT exist, the err is 1004. I see elsewhere there
is reference to Error( ) where 53 is one of them and 55 is
the other, but I cannot seem to figure out how to check
these. Right now, I am using the first 5 chars of the
error DESCR and it works, but I don't like that approach.
Help please! ; -)




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
Trapping errors in a VLOOKUP function Blue Max Excel Worksheet Functions 1 April 26th 09 03:03 AM
Trapping errors with Conditional Formatting Sandusky Excel Discussion (Misc queries) 3 January 6th 09 08:52 PM
Trapping an open Workbook Neil Excel Programming 1 December 12th 03 11:32 AM
annoying bell when trapping errors Mika Excel Programming 0 November 7th 03 10:41 AM
Remind me to set Error Trapping to Break on Unhandled Errors don Excel Programming 0 November 5th 03 06:06 PM


All times are GMT +1. The time now is 07:54 PM.

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

About Us

"It's about Microsoft Excel"