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

Want to check if file exists zzz.xxx if true call a macro KillFile if not
exit
Blanked out
Thanks
If ("C:\Parade\zzz.txt") Then
Call KillFile
Exit Sub
' Else
End If
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If file exists then

If Len(Dir("C:\Parade\zzz.txt")) 0 Then ' File exists

Rick


"Curt" wrote in message
...
Want to check if file exists zzz.xxx if true call a macro KillFile if not
exit
Blanked out
Thanks
If ("C:\Parade\zzz.txt") Then
Call KillFile
Exit Sub
' Else
End If


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default If file exists then

Curt,

Public Function FileExists(FileName as String) As Boolean
FileExists = Len(Dir(FileName))
End Function

If FileExists("C:\Parade\zzz.txt") Then
Call KillFile
Exit Sub
Else
'Whatever
End If

HTH,
John

"Curt" wrote in message
...
Want to check if file exists zzz.xxx if true call a macro KillFile if not
exit
Blanked out
Thanks
If ("C:\Parade\zzz.txt") Then
Call KillFile
Exit Sub
' Else
End If


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 if a sheet exists in a file, without opening that file Bogdan Excel Programming 5 March 9th 07 01:46 PM
File Exists Mike McLellan Excel Discussion (Misc queries) 2 May 4th 06 09:20 AM
File Exists Pflugs Excel Programming 2 September 4th 05 07:05 AM
IF File Exists [email protected] Excel Programming 1 November 22nd 04 07:24 PM
the file already exists - do you want to replace the existing file? Paul James[_3_] Excel Programming 4 December 12th 03 02:50 AM


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