-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Powershell 3.0 compatibility fix #126
Conversation
Fixed problem with conditional formatting code that was breaking in Powershell 3
Sorry, I haven't been able to run any of the unit tests. Please let me know if there are any problems with this! |
Bummer, the # Test conditional text and format
$file="C:\Temp\TestChanges.xlsx"
rm $file -ErrorAction Ignore
$data = $(
New-PSItem 1 2 3
New-PSItem 4 5 6
#New-PSItem a b c
New-PSItem 1 2 3
New-PSItem 4 5 6
)
#$ct = New-ConditionalText b
#$data | Export-Excel $file -show -ConditionalText $ct
$cf = New-ConditionalFormattingIconSet -Range "B:B" -ConditionalFormat ThreeIconSet -IconType Arrows
$data | Export-Excel $file -show -ConditionalFormat $cf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the ConditionalFormat
, I believe it should be $format.Range
, that solved the error on my side. Please see if it works for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from $format.Address to $format.Range
That looks good to me! |
Thanks! Much appreciated. Question, I don't have PS v3.0 to run this on. How did this manifest itself? Did the module not load? Did it only cause errors when using the conditional sections? Did it just not produce the right results? Thanks again |
You get the error when loading the module. You don't need to even invoke On Wed, Sep 28, 2016 at 1:28 AM, Doug Finke notifications@github.com
Nick Head // +44 791 878 4742 // nick@headsphere.net // www.headsphere.net |
Thanks! Yes, PowerShell parses the target file(s) and determines what are terminating errors, even before execution. Not for everything, and I don't keep those rules in my head. :-) This is great. This clears some more hurdles for folks who have tried to use this in v3.0 |
Fixed issue #44 with conditional formatting code that was breaking in Powershell 3