Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

How to get cell format of xls

by bimleshsharma (Beadle)
on May 23, 2012 at 06:49 UTC ( #971959=perlquestion: print w/ replies, xml ) Need Help??
bimleshsharma has asked for the wisdom of the Perl Monks concerning the following question:

I am getting format of cell but i am unknown about the actual properties. Because i have to use same format for other cell if bg_color=red. I am using code below to get format..
# Get the format from the cell my $format = $template->{Worksheet}[$sheet] ->{Cells}[$row][$col] ->{FormatNo};

Comment on How to get cell format of xls
Download Code
Re: How to get cell format of xls
by moritz (Cardinal) on May 23, 2012 at 07:11 UTC
Re: How to get cell format of xls
by bimleshsharma (Beadle) on May 23, 2012 at 09:43 UTC
    i am using module as below
    use Spreadsheet::ParseExcel::SaveParser; my $template = $parser->Parse('compare_reports/38_HMI1071_cre_cdo_G.xl +s'); # Get the format from the cell my $worksheet = $template->worksheet($sheet); my $val=$worksheet->get_cell($row,$col)->value()
    I am getting error (Can't call method "value" on an undefined value at)when cell($row,$col) is blank. How to handle blank cell. pls help.

      Have you tried not calling ->value when ->get_cell() returns undef? What happened when you tried it?

        Ok, i used below but getting error...
        if(undef $worksheet->get_cell($row,$col)){ next; }
        error now i am getting:"Can't modify non-lvalue subroutine call at ."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://971959]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-10-02 17:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (66 votes), past polls