Graphs are broken after opening and saving with openpyxl

Issue #1211 resolved
Petri Panula created an issue

pip freeze |grep openpyxl openpyxl==2.6.0

I need to automate some excel stuff, but that job can't continue until I find the solution why some graphs are lost and excel corrupted after modifying the Excel with openpyxl..

I tried to remove a lot things from original excel and at least with attached one I'm able to reproduce it with command:

python test.py


python --version Python 2.7.12

Hopefully I can get some clue why this happens..

Comments (7)

  1. CharlieC

    Thanks for the report and the files. Unfortunately, although we try and produce valid OOXML, Excel still sometimes complains and rejects the files meaning that extensive reverse engineering is required. :-/

    An initial investigation suggests that there could be a problem with the second bar chart, but the OOXML validator also complains about the original file.

    As per #1180 it might be an idea to ask Microsoft for more information about what Excel doesn't like because the log it produces is never much help.

  2. Petri Panula reporter

    Problem graph is named "graph copied from external doc".. We do not know yet why just that graph is causing problems

  3. CharlieC

    So, the problem is related to a single attribute in the title:

          <a:pPr marL="0" marR="0" lvl="0" indent="0" algn="ctr" defTabSz="Values must be of type <class 'int'>" rtl="0" eaLnBrk="1" fontAlgn="auto" latinLnBrk="0" hangingPunct="1">
    

    For some reason defTabSz has not been assigned a value and contains the description instead.

  4. Log in to comment