Add FullCalcOnLoad fix to Export-Excel direct save path

Co-authored-by: dfinke <67258+dfinke@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-26 21:33:03 +00:00
parent f62aff64db
commit 5040fc0542

View File

@@ -682,6 +682,9 @@
else {
if ($ReturnRange) { $dataRange }
# Set FullCalcOnLoad to false to prevent Excel from corrupting formulas during recalculation
# This fixes issues with table-structured references like [[#This Row],[ColumnName]]
$pkg.Workbook.FullCalcOnLoad = $false
if ($Password) { $pkg.Save($Password) }
else { $pkg.Save() }
Write-Verbose -Message "Saved workbook $($pkg.File)"