If file exists then

C

Curt

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
 
J

John Wilson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top