0

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.

1 Answer 1

0

Got a solution to this answer here and it works too !

Need to add following folder:

Windows 2008 Server x64

Please make this folder.

C:\Windows\SysWOW64\config\systemprofile\Desktop

・Windows 2008 Server x86

Please make this folder.

C:\Windows\System32\config\systemprofile\Desktop

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.