mirror of
https://github.com/dfinke/ImportExcel.git
synced 2026-02-21 20:03:24 +00:00
Added ConditionalText and ConditionalTextColor
This commit is contained in:
@@ -45,6 +45,8 @@ function Export-Excel {
|
||||
[string]$TableName,
|
||||
[OfficeOpenXml.Table.TableStyles]$TableStyle="Medium6",
|
||||
[Object[]]$ConditionalFormat,
|
||||
[string]$ConditionalText,
|
||||
[System.Drawing.Color]$ConditionalTextColor="Red",
|
||||
[Object[]]$ExcelChartDefinition,
|
||||
[string[]]$HideSheet,
|
||||
[Switch]$KillExcel,
|
||||
@@ -336,6 +338,12 @@ function Export-Excel {
|
||||
}
|
||||
}
|
||||
|
||||
if($ConditionalText) {
|
||||
$rule=$ws.Cells[$ws.Dimension.Address].ConditionalFormatting.AddContainsText();
|
||||
$rule.Text = $ConditionalText
|
||||
$rule.Style.Font.Color.Color = $ConditionalTextColor
|
||||
}
|
||||
|
||||
$pkg.Save()
|
||||
$pkg.Dispose()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user