Skip to content

Commit

Permalink
Added $NoFormulaConversion
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ0hn committed Oct 28, 2024
1 parent dc4a5e9 commit 0c09fb6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Public/Export-Excel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
[Switch]$DisplayPropertySet,
[String[]]$NoNumberConversion,
[String[]]$NoHyperLinkConversion,
[String[]]$NoFormulaConversion,
[Object[]]$ConditionalFormat,
[Object[]]$ConditionalText,
[Object[]]$Style,
Expand Down Expand Up @@ -330,7 +331,10 @@
#Other objects or null.
if ($null -ne $v) { $ws.Cells[$row, $ColumnIndex].Value = $v.toString() }
}
elseif ($v[0] -eq '=') {
elseif ( $v[0] -eq '=' -and
$NoFormulaConversion -ne '*' -and
$NoFormulaConversion -notcontains $Name
) {
$ws.Cells[$row, $ColumnIndex].Formula = ($v -replace '^=', '')
if ($setNumformat) { $ws.Cells[$row, $ColumnIndex].Style.Numberformat.Format = $Numberformat }
}
Expand Down

0 comments on commit 0c09fb6

Please sign in to comment.