T
T
Greetings,
I'm using the CPAN package Spreadsheet:arseExcel to try and get
values of the cells. This works fine until I try to get the color of
the font. I'm using the examples provide in the docs:
use Spreadsheet:arseExcel;
my $parser = Spreadsheet:arseExcel->new();
my $workbook = $parser->Parse('MyExcel.xls');
for my $worksheet ( $workbook->worksheets() ) {
my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
for my $row ( $row_min .. $row_max ) {
for my $col ( $col_min .. $col_max ) {
my $cell = $worksheet->get_cell( $row, $col );
next unless $cell;
print "Row, Col = ($row, $col)\n";
print "Value = ", $cell->value(), "\n";
print "Unformatted = ", $cell->unformatted(), "\n";
print "\n";
my $formats = $cell->get_rich_text();
for my $aref (@$formats) {
my $font = $aref->[1];
print "Color = ", $font->{Color}, "\n";
}
}
}
}
Not sure what I'm doing wrong here, It looks like the get_rich_text
(), isn't returning anything. I'm just not sure why. Thanks for any
help in advance!
Tom
I'm using the CPAN package Spreadsheet:arseExcel to try and get
values of the cells. This works fine until I try to get the color of
the font. I'm using the examples provide in the docs:
use Spreadsheet:arseExcel;
my $parser = Spreadsheet:arseExcel->new();
my $workbook = $parser->Parse('MyExcel.xls');
for my $worksheet ( $workbook->worksheets() ) {
my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
for my $row ( $row_min .. $row_max ) {
for my $col ( $col_min .. $col_max ) {
my $cell = $worksheet->get_cell( $row, $col );
next unless $cell;
print "Row, Col = ($row, $col)\n";
print "Value = ", $cell->value(), "\n";
print "Unformatted = ", $cell->unformatted(), "\n";
print "\n";
my $formats = $cell->get_rich_text();
for my $aref (@$formats) {
my $font = $aref->[1];
print "Color = ", $font->{Color}, "\n";
}
}
}
}
Not sure what I'm doing wrong here, It looks like the get_rich_text
(), isn't returning anything. I'm just not sure why. Thanks for any
help in advance!
Tom