I am trying to create an xlsx file with the xlsxwriter python plugin. In this XLSX, I have 2 sheets:
- Analysis : contains a table with information
- Stat . Contains some information and 2 formulas
These two formulas are:
=NBVAL(Analyse!C:C)-1 =NB.SI(Analyse!D:D;"To change")
My problem is that when I open the generated file, I have an error. And the formulas do not work. If I edit the formula and just press Enter, it will work.
My code is:
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 it:
<?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>
source share