refactor: Replace SaveAs2 with standard SaveAs method in Excel conversion
This commit is contained in:
parent
cc887b4d3e
commit
b8049f6f85
@ -494,22 +494,8 @@ function Convert-Files {
|
|||||||
$xlOpenXMLWorkbook = 51 # Excel constant for XLSX format
|
$xlOpenXMLWorkbook = 51 # Excel constant for XLSX format
|
||||||
$xlNormal = 1 # Excel constant for normal save
|
$xlNormal = 1 # Excel constant for normal save
|
||||||
|
|
||||||
# Use the Excel Application SaveAs2 method
|
# Use the standard SaveAs method
|
||||||
$workbook.SaveAs2(
|
$workbook.SaveAs($excelXlsxPath, $xlOpenXMLWorkbook)
|
||||||
$excelXlsxPath,
|
|
||||||
$xlOpenXMLWorkbook, # FileFormat = xlsx
|
|
||||||
$null, # Password
|
|
||||||
$null, # WriteResPassword
|
|
||||||
$false, # ReadOnlyRecommended
|
|
||||||
$null, # CreateBackup
|
|
||||||
$xlNormal, # AccessMode
|
|
||||||
$null, # ConflictResolution
|
|
||||||
$true, # AddToMru
|
|
||||||
$null, # TextCodepage
|
|
||||||
$null, # TextVisualLayout
|
|
||||||
$false # Local
|
|
||||||
)
|
|
||||||
|
|
||||||
$workbook.Close($true) # True to save changes
|
$workbook.Close($true) # True to save changes
|
||||||
|
|
||||||
Start-Sleep -Seconds 2 # Give Excel more time to finish saving
|
Start-Sleep -Seconds 2 # Give Excel more time to finish saving
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user