Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Excel::Writer::XLSX write_comment and text color

by poj (Abbot)
on Mar 04, 2018 at 17:05 UTC ( [id://1210318]=note: print w/replies, xml ) Need Help??


in reply to Excel::Writer::XLSX write_comment and text color

Is this possible?

On windows using Win32::OLE

#!perl use strict; use Win32::OLE 'in'; use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # Die on Errors. # config my $dir = 'c:/temp/'; my $file = 'perl.xlsx'; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts} = 0; #$Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Open($dir.$file); my $ws = $Book->Worksheets(1); for my $c (in $ws->comments) { print $c->text."\n"; my $str = $c->{'Shape'}->{'TextFrame'}->Characters(); $str->{'Font'}->{'ColorIndex'} = 3; # red } # close $Book->Save; $Excel->Quit(); undef $Book; undef $Excel;
poj

Log In?
Username:
Password:

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

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

    No recent polls found