简体   繁体   中英

Perl Excel::Writer::XLSX formula not calculating when workbook is opened

I am writing a formula to an xlsx using Excel::Writer::XLSX.

When I open the workbook with Excel, there is a 0 in the cell with the formula.

The Calculation Options in Excel is set to Automatic. Clicking on the "Calculate now" button or pressing F9 fails to do anything.

Pressing CTRL+Alt+F9 works.

Is there any way to make sure the formula is calculated when the workbook is opened?

EDIT: Cell contents example "=A3+A4".

There was an issue in early versions of Excel 2007 which affects Excel::Writer::XLSX files in this way.

Applying the latest Excel or Office Service packs should fix it.

If not let me know.

Excel::Writer::XLSX has a $worksheet->write_formula method that can be used as a workaround. It has a value field to store the result of the formula if you have a version of Excel that is affected by John's answer above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM