Thanks. I should have thought of that as well.
I kind of confirms my theory. That the problem was the OpenText command was failing because inputfile was only a file name and not a complete path.
Using ChDir should fix the problem. The "not reliably" part of it is always troubling. I can tell you that the filesearch routine works for me VERY reliably.
But, to stick with your current program (and why not, if you can make it reliable, you already know it), you might make two changes.
First, replace "Path" with something else, like "myPath". The word Path has a meaning in Excel, and when you use the command
You are changing the path where your autorecovery files are stored.
Second, change the line below:
This should make it more reliable.
Bookmarks