Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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
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
Check Folder For Files Dave Excel Discussion (Misc queries) 6 November 20th 07 11:16 PM
Check if a folder has x files in it. Dave Excel Discussion (Misc queries) 8 November 15th 07 03:35 PM
how do i check an open files size? Bri_paul Excel Discussion (Misc queries) 1 August 16th 06 04:45 PM
check properties of 400 Excel files Mark Excel Discussion (Misc queries) 2 June 8th 05 02:58 PM
How to check for dupes on 2 files, and ? about csv file ext PeterM Excel Discussion (Misc queries) 2 June 4th 05 10:51 PM


All times are GMT +1. The time now is 06:18 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"