Thread: Does File Exist
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_101_] dominicb[_101_] is offline
external usenet poster
 
Posts: 1
Default Does File Exist


Good afternoon ceemo

The example below will check whether your C:\ drive contains a fil
called filename.xls. In the unlikely event that it does, "TRUE" wil
be returned in a msgbox, otherwise (and probably) "FALSE" will b
returned.

Sub DoesFileExist()
Set MyFile = CreateObject("Scripting.FileSystemObject")
MsgBox MyFile.FileExists("c:\filename.xls")
End Sub

HTH

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=39949