Nichols, Ron wrote: > > I am generating a spreadsheet using Spreadsheet::WriteExcel . > Everything is working fine except a formula containing =SUMIF(A5:A10, > C15,C5:C10). The formula gets generated correctly in the spre adsheet > but in order to get the resulting value to be displayed in the cell, > you have to edit the cell (i.e., click in the edit bar, hit enter) . > After performing an edit (without changing anything), the formula is > evaluated correctly and displays the value. > > Is there any way to get the formula to evaluate without having to edit > the cell ? The spreadsheet s that I am creating are locked so the > user cannot make changes to the formula s. Th e script that creates > the spreadsheet will create hundreds of spreadsheets each time it is > run . > It looks like you can write the formula and the initial value in a cell according to the Spreadsheet::WriteExcel docs (write_formula section):
If required, it is also possible to specify the calculated value of the formula. This is occasionally necessary when working with non-Excel applications that don't calculated the value of the formula. The calculated $value is added at the end of the argument list: $worksheet->write('A1', '=2+2', $format, 4); However, this probably isn't something that will ever need to do. If you do use this feature then do so with care. But that would mean that you'd have to do the initial calculation in perl beforehand. _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs