Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Checking to see if a file exists on c: drive

7 views
Skip to first unread message

KimberlyC

unread,
Jun 25, 2003, 4:53:15 PM6/25/03
to
Hi
I need to run code that checks if a an excel file exists on the c: drive. I
don't know how to do this.....

Any help on how to do this would be greatly appericated.

Thanks in advance,
Kimberly


Bruce M. Thompson

unread,
Jun 25, 2003, 5:38:45 PM6/25/03
to
> I need to run code that checks if a an excel file exists on the c: drive. I
> don't know how to do this.....

Try something like this:

If Len(Dir$("c:\My Documents\MyFile.doc",vbNormal) & "") > 0 Then
'File exists
Else
'File doesn't exist
End If

For more information, see "Dir()" in Access VBA Help.

--
Bruce M. Thompson, Microsoft Access MVP
bthm...@mvps.org (See the Access FAQ at http://www.mvps.org/access)
>>No Email, Please. Keep all communications
within the newsgroups so that all might benefit.<<


0 new messages