Thread: File Search
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
unplugs[_49_] unplugs[_49_] is offline
external usenet poster
 
Posts: 1
Default File Search

Function FileExists(fname As String) As Boolean
With Application.FileSearch
.LookIn = "C:\ "
.NewSearch
.filename = fname
.Execute

If .FoundFiles.Count = 0 Then
FileExists = False
Else
FileExists = True
End If
End With
End Function



Can anyone help me to check whether the function above correct o
not..? When I debug the code above, whether the file exists or not, th
.FoundFiles.Count is alwaz equal to 0..... Why this happen

--
Message posted from http://www.ExcelForum.com