Hello,
I'd like to have a function which will wait until a particular file exists, or until a specified time passes. Something along the lines of
[VBA]Function WaitForFile (FilePathAndName as String, TimeOutSeconds as Integer) as Boolean[/VBA]
The idea being, the function will return True if the file passed as the first parameter appears before the time expires, or False if the file does not show up before the number of seconds given in the second parameter has passed. I've got the FileExists() function just fine (thanks to the Knowledge Base here), but getting the timing part down (without running the CPU usage up to 100% & checking the disk continuously) has me puzzled. If the program could check for the file every 10 seconds or so, and use minimal CPU cycles in between checks, that would be ideal.
Any thoughts?
Thanks,
G.T.