Sharing a TIP on Scheduling a script that contains excel code.
One of my Script that uses excel was running fine when I was launching it interactively but if scheduled thru
Task scheduler it wasn’t working & threw below errors:
Microsoft Excel cannot access the file
There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open
On researching there found a simple fix , Just create a directory with name Desktop
C:\Windows\SysWOW64\config\systemprofile\Desktop -(64 Bit OS)
C:\Windows\System32\config\systemprofile\Desktop -(32 bit OS)
After doing this my script started running fine, hope this TIP will assist you if you are in same situation.
Thanks for reading
2 thoughts on “Microsoft Excel cannot access the file -PS Script”
Thank you for your post, I upgraded a Domino server from 2008r2 to 2012 and some lotusscript agents were failing with the same error messages.
Thanks for solving this puzzle! Once I created that Desktop folder the script worked perfectly. Thanks again!