Excel workbooks.saveas() error in powershell
I'm trying to convert .xls files to .xlxs I tried many variations of this code but every time i'm facing this error message : Exception lors de l'appel de « SaveAs » avec « 2 » argument(s) : « La méthode SaveAs de la classe Workbook a échoué. » Au caractère C:\temp\xlsx.ps1:18 : 6 try{$opendoc.saveas($basename, $saveFormat)} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId : ComMethodTargetInvocation Here is my code : $excel = new-object -comobject excel.application $excel.Visible = $false $saveFormat =