File Exists

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there an easy way of telling whether or not a file exists? What I am
looking for is something along the lines of =IF
(FILE_EXISTS(C:\FILENAME),"OK","not OK")
 
Best to add a UDF

Function BookExists(wb As String)
BookExists = Len(Dir(wb)) > 0
End Function


and use like


=IF(BookExists("C:\myfile.xls"), "yes","no")


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
Many thanks, Bob

Bob Phillips said:
Best to add a UDF

Function BookExists(wb As String)
BookExists = Len(Dir(wb)) > 0
End Function


and use like


=IF(BookExists("C:\myfile.xls"), "yes","no")


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
Back
Top