[RESOLVED] Directory Searching
I am using Excel 2003 & Access 2003
I need to search a directory structure looking for any Directories which
match a specific code. I am looking in all directories under a specified
directory, I might have as many as 15,000 directories in the tree.
Thus if I have a directory structure of
T:\Base Dir
---Tree One
------Dir 001
------Dir 002
------Dir 004
---Tree Two
------Dir 003
------Dir 005
Then searching for a pattern of 001 under T:\ would return
T:\Base Dir\Tree One\Dir 001
Whilst searching for it under T:\Base Dir\Tree Two would return an Empty
value.
I have tried Application.FileSearch, but it only returns Files, not directories.
I have also tried Dir, but this comes up with a memory error after about 50 calls.
I am currently trying SearchScope & ScopeFolder, but cannot find any documentation
on these, and currently cannot adjust the code from the help files to stop it
from searching my local computer, when I just want it to search a specified
directory.
Can anyone provide a fast searching method for directories only, or a tutorial on SearchScope and ScopeFolder.
Re: [RESOLVED] Directory Searching
i did some testing myself, 6 loops with dir or fso 1 after the other in the order as listed
15.03125 fso
5.984375 dir
3.21875 dir
5.421875 fso
sort of strange results, looks like windows does some sort of caching
there is al so the option of using API jfindfirstfile and findnextfile, but i doubt if there will be any significant difference