If file exists then

  • Thread starter Thread starter Curt
  • Start date Start date
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
 
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
 
Back
Top