Reputation: 6998
I have a vbscript that I'm calling from a batch file. Inside this script it opens an excel file on a sharepoint site. When I run this batch file by dbl clicking it everything works. When I run from the task scheduler the log file shows it's failing to open the excel file on the line:
XL.Workbooks.Open(wrkbook)
Note that it works fine when dbl clicked. I'm guessing it's some kind of permissions or something but not sure who/what/when/where/why. Any ideas?
When I pipe the vbscript error I get:
Microsoft Excel cannot access the file 'file path here' for one of the following reason:
Upvotes: 2
Views: 972
Reputation: 6998
OMG, you have GOT to be kidding me. The answer is a handful of posts below in this thread and you'll never believe it.
Literally, and I'm not joking here, all I had to do was create a a folder named 'desktop' in C:\windows\SysWOW64\config\systemprofile. So the final path is 'C:\windows\SysWOW64\config\systemprofile\desktop'.
Can you believe that? That's insane.
Upvotes: 2