I'm personally not terribly familiar with the module in question, but based upon the documentation, there doesn't appear to be range support for the write method. However, you could implement the functionality you desire using nested loops. You could use row-column notation like:
$format = $workbook->add_format(border => 1); for my $row (0 .. 2) { for my $column (0 .. 3) { $worksheet->write($row, $column,'undef',$format); } }
or using A1 notation:
$format = $workbook->add_format(border => 1); for my $row (1 .. 3) { for my $column ('A' .. 'D') { $worksheet->write($column.$row,'undef',$format); } }
Note that Perl is smart enough to deal with alphabetic indices in a limited fashion using Auto increment and Auto decrement and the Range Operators.
As a side note, if you wish to link to a module on CPAN on PerlMonks, use the notation [mod://spreadsheet::WriteExcel]. See more information in What shortcuts can I use for linking to other information?.
In reply to Re: spreadsheet write excel border creation
by kennethk
in thread spreadsheet write excel border creation
by skywalker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |