Pre-calculate Excel Formulas When Exporting Data With Python?
The code is pulling and then putting the excel formulas and not the calculated data of the formula. xxtab.write(8, 3, '=H9+I9') When this is read in and stored in that separate f
Solution 1:
The intended goal is to have the math done either during export, after it is exported but before it is imported to another file, or during import.
XlsxWriter, the module shown writing the Excel file, doesn't evaluate the result of the formulas that it writes. If you calculate the result in your code you can add it when writing the formula:
xxtab.write(8, 3, "=H9+I9", 42)
This is explained in more detail in the Working with Formulas section of the XlsxWriter documentation.
None of the Python Excel file writing modules evaluate formulas. The only modules that could do that are ones that automate Excel such as XlWings.
Post a Comment for "Pre-calculate Excel Formulas When Exporting Data With Python?"