Verify Directory

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

How can I verify if a directory exists before I start a
process. I have used before:

If Dir("C:\My Documents\xlfilename.xls")="" Then ...

but that is to see if a file exists. How do I test if a
directory exists.

Thank you for your help.

Steven
 
If Dir("C:\My Documents", vbDirectory)="" Then

Actually, the following is slightly more efficient:

If Len(Dir("C:\My Documents", vbDirectory)) = 0 Then
 
That is beautiful and very useful. Thank you.
-----Original Message-----
If Dir("C:\My Documents", vbDirectory)="" Then

Actually, the following is slightly more efficient:

If Len(Dir("C:\My Documents", vbDirectory)) = 0 Then


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)






.
 
Back
Top