I need to search the file system (a drive usually) for a fully defined file path while given only a fragment of the file name.
The fragment is actually the part number of the part, and the files to search are all of type '.idw'. Further, they are named with a series that helps sort them; ie 1XX-XXXX.idw, 2XX-XXX.idw.
There are 50,000+ files and just using a FileScriptingObject and recursive reading each folder then comparing them takes something like 2 minutes per search.
(Given a list of part numbers, I need to populate a column in Excel with the full file name)
I'm guessing my best way to go about this is to generate an indexed list of all of the idw files I'm looking for, reducing the full file string to only the base name and using that as the key. However, this would still required the timely run at the start of each search assuming I use this dictionary/collection/list over and over per run.
Is there any way to store a dictionary in an external file, so I can generate the indexed list once per day or a lot less frequently?
Otherwise, is there a better way to do this with VBA that I have not thought of?