I am trying to run a Powershell script, which opens and modifies an Excel spreadsheet, from a SQL Agent job step, . The script runs fine by itself, and from BIDS. I have tried running as an SSIS pkg with a proxy, and when that didn't work I setup the step to simply run the Powershell script.
This is the error I receive:
A job step received an error at line 17 in a PowerShell script. The corresponding line is
Correct the script and reschedule the job.
The error information returned by PowerShell is: "Exception calling "Open" with "5" arguments(s).
"Microsoft Excel cannot access the file "\\files\reporting\Dailyreport_MMDDYYYY.xls".
There are several possible reasons:
The file name or path does not exist (Yes, it does!)
The file is being used by another program (No, it’s not!)
The workbook you are trying to save has the same name as a currently open workbook." (No again, no workbooks open)
Process Exit Code -1. The step failed
It appears that it does not want to open Excel, but why?
FYI: 64-bit System, 64-bit SQL 2008 R2, 32-bit Office 2010.
I have already tried adding "Desktop" to SysWoW64 and editing my DCOM settings, with no change in results.