Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perl Monks,
Is there any way to highlight row in an excel file using CPAN module
I couldn't find any solution in Spreadsheet::WriteExcel.
Could you please help me to get soln
Thanks

Replies are listed 'Best First'.
Re: highlight row in excel
by toolic (Bishop) on May 20, 2011 at 18:55 UTC
Re: highlight row in excel
by Khen1950fx (Canon) on May 21, 2011 at 21:22 UTC
    Take a look at Spreadsheet::WriteExcel::Styler. It makes highlighting simple:
    #!/usr/bin/perl use strict; use Spreadsheet::WriteExcel; use Spreadsheet::WriteExcel::Styler; my $workbook = Spreadsheet::WriteExcel->new('output.xls'); my $worksheet = $workbook->add_worksheet(); my $styler = Spreadsheet::WriteExcel::Styler->new($workbook); $styler->add_styles( highlighted => {bg_color => 'yellow'}, ); my $data = "OK"; $worksheet->write(0, 0, $data, $styler->({highlighted => 1}));
Re: highlight row in excel
by dasgar (Priest) on May 20, 2011 at 23:06 UTC

    From a non-Windows system, I'm not sure which module(s) would allow you to do this.

    From a Windows system that has Excel, I would recommend using Win32::OLE to directly manipulate Excel to accomplish the task. (At least this is how I would approach the task.)