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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |