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
|
||||
$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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user