Powershell: Error while calling the SaveAs Method of some Office Applications


if you tried to save a word or excel document as another format you got an error. For example, if you want to convert a CSV File to a Excel workbook and save it in Excel 95/97/2003 format.

$oExcel = New-Object -ComObject "Excel.Application"
$oExcel.Visible = $true
Exception calling "SaveAs" with "1" argument(s): "SaveAs method of Workbook class failed"
At D:\test\CSV2Excel.ps1:29 char:20
+ $xl_workbook.SaveAs <<<< ("D:\Temp\test.xls")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation

More »

Advertisment to support michlstechblog.info

Original Theme by Schiy · Powered by WordPress