B
Bill
Hello,
I am using the following code to find a file on the C drive. The file is
there, but the code keeps saying no file was found. Any help? Thanks.
Sub test()
Set fs = Application.FileSearch
With fs
.LookIn = "C"
.Filename = "Fname.xls"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub
I am using the following code to find a file on the C drive. The file is
there, but the code keeps saying no file was found. Any help? Thanks.
Sub test()
Set fs = Application.FileSearch
With fs
.LookIn = "C"
.Filename = "Fname.xls"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub