View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
tinyjack[_3_] tinyjack[_3_] is offline
external usenet poster
 
Posts: 1
Default Check or a file exist give wrong result

I would not use the FileSearch object to do this, you can just use th
Dir function:


Code
-------------------

Sub test()

Dim strFound As String

strFound = Dir(Interaction.Environ$("userprofile") & "\My Documents\Test files\up12_7.txt")

If Len(strFound) 0 Then
MsgBox "File found"
Else
MsgBox "File NOT found."
End If

End Sub

-------------------


HTH

T

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