I am using SharePoint 2010 and I get following error when I try to save an Excel file via Power Shell:
ERROR: Exception calling "SaveAs" with "2" argument(s): "SaveAs method of Workbook class failed"
Command used for saving file is as follows:
$workbook.SaveAs(<FULL PATH WITH FILENAME>,1)
Above code works perfectly when I execute it via Power Shell console. But I am using Ingo Karstein's utility to run Power Shell as Timer Job where this command fails. Other commands in script works fine, also it creates log,csv files without any issue. Issue occurs only while saving an Excel file.