bblustein has asked for the wisdom of the Perl Monks concerning the following question:
But I need not only the cell value, defined in $oWkC->Value, but the background color of the cell. The documentation provides that "Format" is a cell property, the same way "Value" is. So...$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$strExcelPath"); foreach my $oWkS (@{$oBook->{Worksheet}}) { print "--------- SHEET:", $oWkS->{Name}, "\n"; for(my $iR = $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{ +MaxCol} ; $iC++) { $oWkC = $oWkS->{Cells}[$iR][$iC]; print "( $iR , $iC ) =>", $oWkC->Value, "\n" if($oWkC) +;
Should return the format information to the $oFormat object. Now, Fill is a property of the Format object, so...$oFormat = $oWkC->Format;
Should return, according to the documentation: Array ref of fill pattern and color indexes : [Pattern, Front Color, Back Color] But this is where I'm stuck. No matter how many different ways I've tried writing it, I am unable to get the program to spit out the Pattern, front color, or back color. Can anyone help me out with the proper format of this?$oFill = $oFormat->Fill;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ParseExcel - need background color info
by jmcnamara (Monsignor) on Sep 07, 2006 at 16:47 UTC | |
|
Re: ParseExcel - need background color info
by ptum (Priest) on Sep 07, 2006 at 16:30 UTC |