File Search

F

Francis Ang

When I run my codes using Excel Version 10.0 under Windows XP it is fine but when I run the same code using Excel Version 8.0e under Windows 1998, it would output 'There were no files found" despite the fact files (*cf) are present. Can anyone tell me where I've gone wrong with codes

Set fs = Application.FileSearc
With f
.LookIn = "C:\My Documents
.FileName = "*cf
If .Execute(SortBy:=msoSortbyFileName,
SortOrder:=msoSortOrderAscending) > 0 The
MsgBox "There were " & .FoundFiles.Count &
" file(s) found.
For i = 1 To .FoundFiles.Coun
MsgBox .FoundFiles(i
Next
Els
MsgBox "There were no files found.
End I
End Wit
 
D

Don Guillett

I think I remember that xl97 has a problem with * . Another way,perhaps?

--
Don Guillett
SalesAid Software
[email protected]
Francis Ang said:
When I run my codes using Excel Version 10.0 under Windows XP it is fine
but when I run the same code using Excel Version 8.0e under Windows 1998, it
would output 'There were no files found" despite the fact files (*cf) are
present. Can anyone tell me where I've gone wrong with codes.
 
Top