Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override default XlsxWriter behavior to not recalculate all cells upon opening

According to the documentation:

XlsxWriter doesn’t calculate the result of a formula and instead stores the value 0 as the formula result. It then sets a global flag in the XLSX file to say that all formulas and functions should be recalculated when the file is opened.

This negates the benefit from using the value parameter when using write_formula().

Is there a way to override this behavior so that only cells I haven't given a value for gets recalculated?

Thank you!

like image 801
Joubert Lucas Avatar asked Dec 10 '25 15:12

Joubert Lucas


1 Answers

Is there a way to override this behavior so that only cells I haven't given a value for gets recalculated?

I don't think Excel has an option like that.

You can however, use the XlsxWriter set_calc_mode() method to turn on Excel's manual calculation option for the workbook.

like image 88
jmcnamara Avatar answered Dec 13 '25 06:12

jmcnamara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!