View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Zack Barresse Zack Barresse is offline
external usenet poster
 
Posts: 124
Default FileSearch worked in Excel 97 but not in Excel 2003, how to fix???

It does work in 2003, but does not in 2007. Your variable ...

..filename = "S:\list_file.xls"

.... should be ...

..Filename = "list_file.xls"
..LookIn = "S:\"

HTH

--
Zack Barresse




"August 8" wrote in message
...
The following code worked in Excel 97 but not worked in Excel 2003, why
why
why???
and how to fix??? Thanks!!!

Sub test()

With Application.FileSearch
.NewSearch
.SearchSubFolders = True
.filename = "S:\list_file.xls"
.MatchTextExactly = True
If .Execute() 0 Then
MsgBox "found"
Else
MsgBox "not found"
End If
End With

End Sub