K
Ken Loomis
I use the following to search for files that are ".xls" files and contain a
sub name in the VBA:
MyFilePath is the path to the My Documents folder on whatever system this
runs on
StartTime = Time
With Application.FileSearch
.NewSearch
.FileName = "*.xls"
.LookIn = MyFilePath
.SearchSubFolders = True
.TextOrProperty = "BuildStreetsReports"
.MatchTextExactly = True
.Execute
EndTime = Time
MsgBox ("Done searching. It took " & (EndTime - StartTime) * 24 * 60
& " minutes")
The problem is it can take about 45 minutes to run on my Windows 98 system
and I was just wondering if there is a faster way to do this or a way to
speed up this search. I have no control over where the the user saves the
files I need to find, except that they are supposed to be in the My
Documents folder. If they aren't I am not as concerned about them. I can
handle that manually on a user by user basis. I surely do not want to slow
things down any further by searching the entire hard drive, unless, of
course, that would actually make this search go faster.
Just a note that the time it takes this search to complete is never very
consistent. Sometimes it takes 20 minutes and others it take 45 when run on
the same system with no changes to the files or file structure.
Thanks for any ideas.
Ken
sub name in the VBA:
MyFilePath is the path to the My Documents folder on whatever system this
runs on
StartTime = Time
With Application.FileSearch
.NewSearch
.FileName = "*.xls"
.LookIn = MyFilePath
.SearchSubFolders = True
.TextOrProperty = "BuildStreetsReports"
.MatchTextExactly = True
.Execute
EndTime = Time
MsgBox ("Done searching. It took " & (EndTime - StartTime) * 24 * 60
& " minutes")
The problem is it can take about 45 minutes to run on my Windows 98 system
and I was just wondering if there is a faster way to do this or a way to
speed up this search. I have no control over where the the user saves the
files I need to find, except that they are supposed to be in the My
Documents folder. If they aren't I am not as concerned about them. I can
handle that manually on a user by user basis. I surely do not want to slow
things down any further by searching the entire hard drive, unless, of
course, that would actually make this search go faster.
Just a note that the time it takes this search to complete is never very
consistent. Sometimes it takes 20 minutes and others it take 45 when run on
the same system with no changes to the files or file structure.
Thanks for any ideas.
Ken