Workflow PowerShell Action errors out

Jun 1, 2012 at 8:35 PM
Edited Jun 1, 2012 at 8:39 PM

If I execute the following PowerShell script, it works fine, however, if I execute it from the custom workflow action, I get an error "You cannot call a method on a null-valued expression." The error is on the "$objDoc.PrintOut()" statement.
$objWord = New-Object -comobject Word.Application
$objDoc = $objWord.Documents.Open("http://tfranz6/u-linc/department/Invoices/1000.docx")
$a = $objWord.Quit()
Any help would be appreciated.

Jun 4, 2012 at 7:16 PM

This means you have word installed on the SharePoint Server (not recommended by Microsoft). The problem could be that the action runs under the app pool user or under the SPTimer user. Please check that the script runs under this users.