openpyxl icon indicating copy to clipboard operation
openpyxl copied to clipboard

Error when saving excel with chart

Open cuong02n opened this issue 8 months ago • 0 comments

There is only 2 line of code

workbook = load_workbook(filename='input.xlsx', keep_vba=True, rich_text=True)
# I will do operator here, but there is an error, so I comment this line
workbook.save('output.xlsx')

The input.xlsx

When I try to open output.xlsx, This notification appear Error Notification

And Result: The Chart was remove by MS Excel, Sometime I cannot open it by MS Excel Office, but another App like LibraOffice can open with no error. Result

The alert: enter image description here

  1. Allow openpyxl to read the charts with the right way.
  2. Make openpyxl read specific sheet, and other sheets will be pass.
  3. Avoid openpyxl decrease the size of file (I think openpyxl do it for perfomance)

I asked this question in StackOverFlow

cuong02n avatar Jun 17 '24 09:06 cuong02n