Hi I have been using perl for quite sometime now , basically for creating windows excel sheets using use Excel::Writer::XLSX; . Below is the code snippet just for writing a formula to a cell

use Excel::Writer::XLSX; use Spreadsheet::XLSX; my $workbook = Excel::Writer::XLSX->new( "MY_WORKBOOK"); my $worksheet = $workbook->add_worksheet( "One" ); my $row =0 ; my $col =0; my $formula = qq/=IF(C${formularow}="Manual",SUMIFS(GL!\$L:\$L, GL!\$ +A:\$A, Compare!\$B${formularow}, GL!\$P:\$P, Compare!\$C${formularow} +, GL!\$N:\$N, Compare!\$D${formularow}, GL!\$Q:\$Q, Compare!\$F${form +ularow}),SUMIFS(GL!\$L:\$L, GL!\$A:\$A, Compare!\$B${formularow}, GL! +\$P:\$P, Compare!\$C${formularow}, GL!\$N:\$N, Compare!\$D${formularo +w}, GL!\$O:\$O, Compare!E${formularow}, GL!\$Q:\$Q, Compare!\$F${form +ularow}))/; $worksheet->write_formula( $row,$col,$formula,$num_format);

The above code writes the formula into excel sheet and the formula is calculated when i open the excel sheet in windows. Is there a way that i can get this value in perl itself. Known Issue for Spreadsheet::WriteExcel This module cannot read the values of formulas from files created with Spreadsheet::WriteExcel unless the user specified the values when creating the file (which is generally not the case). The reason for this is that Spreadsheet::WriteExcel writes the formula but not the formula result since it isn't in a position to calculate arbitrary Excel formulas without access to Excel's formula engine. Is it the same with XLSX too.or is there a way that i can get the values not formula's while reading the excel


In reply to read the values of formulas from files created with Spreadsheet::XLSX by tejasvinnakota

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.