LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Open File - Need an warning to appear if file cannnot be found

I was wondering how i would go about adding a warning message that says "File
cannot be found" to the following code if the the test.xls file cannot be
found?

Sub filefile
Workbooks.Open FileName:="C:\test\test.xls"
MyVal = Application.Workbooks("test.xls").Sheets("Sheet1") .Range("A1").Value
Workbooks("test.xls").Close SaveChanges:=False
End Sub

thanks in advance for your help!
 
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
Saved *.csv file gives SYLK file type warning upon Excel 2003 open Tom Excel Discussion (Misc queries) 5 March 19th 08 03:15 PM
Macro warning pops up at file open Texas Tonie[_2_] Excel Discussion (Misc queries) 2 May 3rd 07 06:56 PM
Close an Excel file if is found it open. Chuckles123[_114_] Excel Programming 4 May 7th 06 11:42 AM
File Not Found menu pops up after I open a file Harveytunes Excel Discussion (Misc queries) 3 January 27th 06 07:23 PM
Excel file already open warning binaryben Setting up and Configuration of Excel 0 July 6th 05 12:30 PM


All times are GMT +1. The time now is 11:43 AM.

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"