Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You guys are the best! Thanks!
"David G" wrote: On Apr 17, 12:26 pm, Mike H wrote: one way:- Sub filefile() On Error GoTo errorroutine Workbooks.Open Filename:="C:\test.xls" MyVal = Application.Workbooks("test.xls").Sheets("Sheet1") .Range("A1").Value Workbooks("test.xls").Close SaveChanges:=False Exit Sub errorroutine: msg = "File not found" MsgBox msg End Sub Mike You should probably reset On Error after the file has been opened. Don't want false errors coming up. Add "On Error Goto 0" after the Workbooks.Open line. David G |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Saved *.csv file gives SYLK file type warning upon Excel 2003 open | Excel Discussion (Misc queries) | |||
Macro warning pops up at file open | Excel Discussion (Misc queries) | |||
Close an Excel file if is found it open. | Excel Programming | |||
File Not Found menu pops up after I open a file | Excel Discussion (Misc queries) | |||
Excel file already open warning | Setting up and Configuration of Excel |