Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Missing FILE | Excel Discussion (Misc queries) | |||
FILE MISSING | Excel Discussion (Misc queries) | |||
*.xlb file missing! | Excel Programming | |||
*.xlb file missing?! | Excel Programming | |||
XLB File missing | Excel Programming |