Earlier, near the top, you have this line:
That means you have set Excel's local directory to sPath, whatever that may be. That means you shouldn't need to include the path, you're already in it.
During the time when the macro is actually working, try that edit, you'll find it is still working.
Then the next time it ISN'T working, click on DEBUG and carefully hover your mouse over sPath and sFil in the line of code that is highlighted... what are the current values.
Or press CTRL-G to open the immediate window while that line of code is still highlighted, and type this command into that window?
? sPath & "\" & sFil
What response do you get? Is it exactly right? Even a single errant space (is there one hidden in there anywhere?) will make it not work.
Bookmarks