mirror of
https://github.com/dfinke/ImportExcel.git
synced 2026-01-06 10:33:19 +00:00
Merge pull request #126 from headsphere/patch-1
Powershell 3.0 compatibility fix
This commit is contained in:
@@ -78,7 +78,7 @@ function Export-Excel {
|
||||
|
||||
foreach($format in $ConditionalFormat ) {
|
||||
$target = "Add$($format.Formatter)"
|
||||
$rule = ($ws.ConditionalFormatting).$target($format.Range, $format.IconType)
|
||||
$rule = ($ws.ConditionalFormatting).PSObject.Methods[$target].Invoke($format.Range, $format.IconType)
|
||||
$rule.Reverse = $format.Reverse
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ function Export-Excel {
|
||||
$Range=$targetConditionalText.Range
|
||||
if(!$Range) { $Range=$ws.Dimension.Address }
|
||||
|
||||
$rule=($ws.Cells[$Range].ConditionalFormatting).$target()
|
||||
$rule=($ws.Cells[$Range].ConditionalFormatting).PSObject.Methods[$target].Invoke()
|
||||
|
||||
if($targetConditionalText.Text) {
|
||||
if($targetConditionalText.ConditionalType -match "equal|notequal|lessthan|lessthanorequal|greaterthan|greaterthanorequal") {
|
||||
|
||||
Reference in New Issue
Block a user