S
Stephen Allen
The following code gives a found files count of 3 where only 1 file
exists.
set fs = Application.FileSearch
With fs
.NewSearch
.FileName = "EXCEL.exe"
.LookIn = "C:\Program Files"
.SearchSubFolders = True
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With
fs.Execute
For r = 1 To fs.FoundFiles.Count
MsgBox fs.FoundFiles(r)
Next r
The MsgBox refers to the same file each time "C:\Program
Files\Micrsoft Office\Office\EXCEL.exe"
Any thoughts on how to refine the code to give the expected answer?
exists.
set fs = Application.FileSearch
With fs
.NewSearch
.FileName = "EXCEL.exe"
.LookIn = "C:\Program Files"
.SearchSubFolders = True
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With
fs.Execute
For r = 1 To fs.FoundFiles.Count
MsgBox fs.FoundFiles(r)
Next r
The MsgBox refers to the same file each time "C:\Program
Files\Micrsoft Office\Office\EXCEL.exe"
Any thoughts on how to refine the code to give the expected answer?