You can pretty much just use the example code in Spreadsheet::ParseExcel as I have done below:
use Spreadsheet::ParseExcel; use strict; my $fname = shift; my $oBook = Spreadsheet::ParseExcel::Workbook->Parse($fname); my($iR, $iC, $oWkS, $oWkC); 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]; if ( $oWkC ) { print "( $iR , $iC ) =>", $oWkC->Value, "\n"; my $format = $oWkC->{Format}; my $font = $format->{Font}; if ( $font->{Italic} ) { print( " (italic)\n" ); } } } } }

The clue is to get hold of the 'Font' object from the 'Format' object of the cell in question.

The output I get when feeding in an example spreadsheet I created myself was:

[root@monarch monarch]# perl /tmp/parseexcel.pl /tmp/deleteme.xls --------- SHEET:Sheet1 ( 1 , 1 ) =>This cell is normal ( 2 , 1 ) =>This cell is italic (italic) ( 3 , 1 ) =>This cell is normal --------- SHEET:Sheet2 --------- SHEET:Sheet3

Update: corrected spelling of CPAN module


In reply to Re: Can SpreadSheet::ParseExcel::Font retrieve a cell's formatting? by monarch
in thread Can SpreadSheet::ParseExcel::Font retrieve a cell's formatting? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.