Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Need help converting Excel color scale conditional formatting macro to perl

by WheelbarrowRacers (Initiate)
on Feb 20, 2015 at 00:51 UTC ( [id://1117290]=note: print w/replies, xml ) Need Help??


in reply to Re: Need help converting Excel color scale conditional formatting macro to perl
in thread Need help converting Excel color scale conditional formatting macro to perl

Poj, I did have to make a couple of changes for the example you so wonderfully provided to work on my machine.

For the lines setting the Type, like this one: $csc->{1}->{'Type'} = xlConditionValueLowestValue; I needed to put quotes around the value like this: $csc->{1}->{'Type'} = 'xlConditionValueLowestValue';

When I used this line to start Excel: my $excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); I got this error:

Win32::OLE(0.1709) error 0x80020005: "Type mismatch" in PROPERTYPUT "Type" at OleExcelTipsTricks3.pl line 42.
However, no other code changes were needed if I launched Excel this way: my $excel = CreateObject OLE "Excel.Application";

No clue yet, why the difference in launching Excel mattered in my case, but just wanted to share that in case it matters for someone else.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1117290]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found