Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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
[james28909]: also remember, that if 'Today' is may 1, then Yesterday is not may 31 lol
[james28909]: theoretically speaking ofcourse
[james28909]: so if you subtracting as you loop, be aware that you will eventually be subtracting into a past month, or year <.<
[james28909]: dontcha love it!
[james28909]: Today would be scalar localtime. Yesterday would be scalar localtime - 1. sunday - monday would variate scalar localtime - ?
[james28909]: oops s/sunday - monday/sunday - saturday/
[james28909]: my mind is blown haha

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2017-04-29 03:55 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.