From 5040fc05427c9c1070758e08dc5174873df9d319 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Dec 2025 21:33:03 +0000 Subject: [PATCH] Add FullCalcOnLoad fix to Export-Excel direct save path Co-authored-by: dfinke <67258+dfinke@users.noreply.github.com> --- Public/Export-Excel.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Public/Export-Excel.ps1 b/Public/Export-Excel.ps1 index 5c08b20..bebf574 100644 --- a/Public/Export-Excel.ps1 +++ b/Public/Export-Excel.ps1 @@ -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)"