Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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};

Replies are listed 'Best First'.
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.
        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 ."

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://971959]
Approved by marto
[holli]: i am designing an interface. check this out, can you tell immediatly tell me what the code does?
[holli]: scratch one "tell". you decide which ;)
[danaj]: :) Thanks, I should visit more often.
[holli]: you should visit the link i posted and answer my question
[stonecolddevin]: good afternoon all
[holli]: if you know what's good for you

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-09-26 21:18 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (297 votes). Check out past polls.