Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for files
Mornin' all,
I have a macro in excel that runs automatically. I want it to check to see if the trigger file is there before running. The process that happens before this saves a text file, if that text file isn't there, thir proceedure should cancel. Any ideas? Thanks for your help! Foss |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for files
Hi,
Try If Dir("Yourfile and path here e.g c:\book1.xls") < "" Then ' Run your code here end if HTH, Mark "Foss" wrote: Mornin' all, I have a macro in excel that runs automatically. I want it to check to see if the trigger file is there before running. The process that happens before this saves a text file, if that text file isn't there, thir proceedure should cancel. Any ideas? Thanks for your help! Foss |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for files
You can use this API:
Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long pszPah is the fully qualified name of the file whose exisence you want to check. The result is 0 when the file does not exist. "Foss" wrote: Mornin' all, I have a macro in excel that runs automatically. I want it to check to see if the trigger file is there before running. The process that happens before this saves a text file, if that text file isn't there, thir proceedure should cancel. Any ideas? Thanks for your help! Foss |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for files
Hi,
Thanks very much, I'll give that a dig! Cheers, Foss -----Original Message----- Hi, Try If Dir("Yourfile and path here e.g c:\book1.xls") < "" Then ' Run your code here end if HTH, Mark "Foss" wrote: Mornin' all, I have a macro in excel that runs automatically. I want it to check to see if the trigger file is there before running. The process that happens before this saves a text file, if that text file isn't there, thir proceedure should cancel. Any ideas? Thanks for your help! Foss . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for files
Hi,
Thanks very much, I'll give that a dig! Cheers, Foss -----Original Message----- You can use this API: Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long pszPah is the fully qualified name of the file whose exisence you want to check. The result is 0 when the file does not exist. "Foss" wrote: Mornin' all, I have a macro in excel that runs automatically. I want it to check to see if the trigger file is there before running. The process that happens before this saves a text file, if that text file isn't there, thir proceedure should cancel. Any ideas? Thanks for your help! Foss . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check Folder For Files | Excel Discussion (Misc queries) | |||
Check if a folder has x files in it. | Excel Discussion (Misc queries) | |||
how do i check an open files size? | Excel Discussion (Misc queries) | |||
check properties of 400 Excel files | Excel Discussion (Misc queries) | |||
How to check for dupes on 2 files, and ? about csv file ext | Excel Discussion (Misc queries) |