diff --git a/SharePointFunctions.ps1 b/SharePointFunctions.ps1 index af99555..bbe0bb1 100644 --- a/SharePointFunctions.ps1 +++ b/SharePointFunctions.ps1 @@ -494,22 +494,8 @@ function Convert-Files { $xlOpenXMLWorkbook = 51 # Excel constant for XLSX format $xlNormal = 1 # Excel constant for normal save - # Use the Excel Application SaveAs2 method - $workbook.SaveAs2( - $excelXlsxPath, - $xlOpenXMLWorkbook, # FileFormat = xlsx - $null, # Password - $null, # WriteResPassword - $false, # ReadOnlyRecommended - $null, # CreateBackup - $xlNormal, # AccessMode - $null, # ConflictResolution - $true, # AddToMru - $null, # TextCodepage - $null, # TextVisualLayout - $false # Local - ) - + # Use the standard SaveAs method + $workbook.SaveAs($excelXlsxPath, $xlOpenXMLWorkbook) $workbook.Close($true) # True to save changes Start-Sleep -Seconds 2 # Give Excel more time to finish saving