Editing an Excel file with Planmaker invalidates its access with python module openpyxl

Post Reply
mbb
Posts: 24
Joined: Thu Dec 07, 2017 11:53 am

Editing an Excel file with Planmaker invalidates its access with python module openpyxl

Post by mbb »

Hi!

I'm working on a small script in python, which, among other things, opens and manipulates Excel files. Upon testing the script, I noticed that if I edit a file in Planmaker, then I can't open it with openpyxl (I haven't tried other python modules).

The error displayed is the following:

Code: Select all

Traceback (most recent call last):
  File "/home/mochobb/projects/cmvfat/tests/cmvfat.py", line 82, in <module>
    wbEDOC=load_workbook(str(fEDOC[int(iEDOC)]), read_only=False, data_only=False)
  File "/usr/lib/python3.10/site-packages/openpyxl/reader/excel.py", line 346, in load_workbook
    reader.read()
  File "/usr/lib/python3.10/site-packages/openpyxl/reader/excel.py", line 299, in read
    apply_stylesheet(self.archive, self.wb)
  File "/usr/lib/python3.10/site-packages/openpyxl/styles/stylesheet.py", line 198, in apply_stylesheet
    stylesheet = Stylesheet.from_tree(node)
  File "/usr/lib/python3.10/site-packages/openpyxl/styles/stylesheet.py", line 103, in from_tree
    return super(Stylesheet, cls).from_tree(node)
  File "/usr/lib/python3.10/site-packages/openpyxl/descriptors/serialisable.py", line 83, in from_tree
    obj = desc.from_tree(el)
  File "/usr/lib/python3.10/site-packages/openpyxl/descriptors/sequence.py", line 94, in from_tree
    return [self.expected_type.from_tree(el) for el in node]
  File "/usr/lib/python3.10/site-packages/openpyxl/descriptors/sequence.py", line 94, in <listcomp>
    return [self.expected_type.from_tree(el) for el in node]
  File "/usr/lib/python3.10/site-packages/openpyxl/styles/fills.py", line 64, in from_tree
    return PatternFill._from_tree(child)
  File "/usr/lib/python3.10/site-packages/openpyxl/styles/fills.py", line 102, in _from_tree
    return cls(**attrib)
TypeError: PatternFill.__init__() got an unexpected keyword argument 'extLst'
I attached two excel files. It is the same file, but one of them (ending with '0') was edited with MS Excel and the other was edited with Planmaker.

The error posted above already contains the line of code where it fails on the 2nd line (I only try to open the file). The code works normally if the two files are edited with MS Excel, so the problem isn't there.

I am aware this can be a problem on openpyxl side, but I thought reporting this problem here and making the files available could lead the Softmaker team to find some minor flaw which needs to be corrected.

Thank you very much,
Attachments
EDOC_FATURA_18_04_2023_2.xlsx
(9.99 KiB) Downloaded 97 times
EDOC_FATURA_18_04_2023_0.xlsx
(12.82 KiB) Downloaded 122 times
SuperTech
SoftMaker Team
SoftMaker Team
Posts: 2965
Joined: Wed Mar 11, 2020 5:31 pm

Re: Editing an Excel file with Planmaker invalidates its access with python module openpyxl

Post by SuperTech »

Thanks for your post. I have forwarded the details to our developer team.
Post Reply

Return to “BETA PlanMaker 2024 for Linux”