title: Powershell Excel Automation - Save/Open fails in Scheduled Task
body: <p>I created a simple powershell script that will create an excel instance and save a workbook:</p>
  
  <pre><code>$excel = New-Object -ComObject Excel.Application
  $workbook = $excel.Workbooks.Open("C:\Test\foo.xls")
  $workbook.SaveAs("C:\Test\bar.xls")
  
  # cleanup code ...
  </code></pre>
  
  <p>When I run this from powershell directly it works fine.
  I created a scheduled task that runs it, and when I have the option set that will "Run only when the user is logged in" then it will run fine.</p>
  
  <p>When I change this option to run whether the user is logged in or not, it will fail trying to open/save the file. The account I am using has the correct permissions. I have the account set up to Log in as a service.</p>
  
  <p>Any suggestions?</p>