I try to create a XLSX file with xlsxwriter python plugin. In this XLSX, I have 2 sheets:
- Analyse: Contain a table with informations
- Stat: Contain some informations and 2 formulas
This 2 formulas are:
=NBVAL(Analyse!C:C)-1
=NB.SI(Analyse!D:D;"To change")
My problem is when I open the generated file, I have a error. And the formulas don't work. If I edit the formula and just press Enter, it work.
My code:
shInfo = self.__workbook.add_worksheet("Stat")
shInfo.activate()
information = self.__workbook.add_format({'bg_color': '#BFBFBF',
'font_name': 'Courier New'})
shInfo.write('G3','=NBVAL(Analyse!C:C)-1',information)
shInfo.write('G5','=NB.SI(Analyse!D:D;"To change")',information)
When I open the XML error report. I have this:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error056160_04.xml</logFileName>
<summary>Des erreurs ont été détectées dans le fichier « L:\UNMS\InputBEB\Output\UNMSViewer\public_html\Data\XLSX\todo\A6S54300.xlsx »</summary>
<removedRecords summary="Liste des enregistrements supprimés ci-dessous :">
<removedRecord>Enregistrements supprimés: Formule dans la partie /xl/worksheets/sheet2.xml</removedRecord>
</removedRecords>
</recoveryLog>