Thread: missing file
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ADG ADG is offline
external usenet poster
 
Posts: 76
Default missing file

There are a number of ways to check a file exists The DIR function is one.
The below returns WIN.INI if the file exists or an empty string if it does
not you could check the string length that this function returns to tell if
your file exists

Dir("C:\WINDOWS\WIN.INI")
--
Tony Green


"jnewl" wrote:

i have a macro that retrieves csv files, creates pivot tables and builds
excel workbooks. these csv files are from different programs, so my macro
executes a series of macros to get the excel books.
this job is run monthly and some of these files are not available because of
a lack of data. what statement can i use to check for missing file and bypass
the macro so that my master macro does not abend?

thanks