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)
 

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

Back
Top