Home Forums Programming Powershell Open Excel Error Using PowerShell in SQL Server Agent Job RE: Open Excel Error Using PowerShell in SQL Server Agent Job

  • Lrobinson 93181 (6/12/2013)


    Hi,

    Thanks again, it ran the script but wouldn't save:

    "Exception calling "SaveAs" with "1" argument(s):"SaveAs method of Workbook class failed"

    The script runs fine outside of job agent, it creates an excel workbook, adds data to cells, saves, and closes.

    I tried to save to C:\Temp and also to \\files\reports (location of files on original script that won't open Excel).

    I am not sure what this means, although it consistently fails to complete the script (for different reasons), it does appear to run the script.

    A quick search pops up this: http://vwiki.co.uk/Excel_(PowerShell)

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!