Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default missing file

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
  #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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default missing file

You can use this to test if a file exist

If Dir("C:\Data\test.xls") < "" Then MsgBox "Run your code"



--
Regards Ron de Bruin
http://www.rondebruin.nl



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



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
Missing FILE stickman Excel Discussion (Misc queries) 0 November 9th 06 02:49 AM
FILE MISSING Sodamola Excel Discussion (Misc queries) 1 June 8th 05 04:45 PM
*.xlb file missing! aiyer[_37_] Excel Programming 1 August 14th 04 01:43 AM
*.xlb file missing?! aiyer[_35_] Excel Programming 3 August 13th 04 10:12 PM
XLB File missing Nigel[_8_] Excel Programming 1 May 28th 04 09:46 PM


All times are GMT +1. The time now is 12:11 PM.

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"