Error Saving Workbook

Issue #684 duplicate
Denzil Sequeira created an issue

Below is the Traceback for the error I receive on while executing on my server but works fine locally .. Could someone Please have a look

 File "", line 159, in <module>'eir_April2016_copy.xlsx')
  File "/usr/local/lib/python2.7/site-packages/openpyxl/workbook/", line 339, in save
    save_workbook(self, filename)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/", line 268, in save_workbook
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/", line 250, in save
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/", line 81, in write_data
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/", line 199, in _write_worksheets
    xml = ws._write()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/", line 851, in _write
    return write_worksheet(self)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/", line 99, in write_worksheet
    cols = ws.column_dimensions.to_tree()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/", line 230, in to_tree
    obj = col.to_tree()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/", line 182, in to_tree
    attrs = dict(self)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/", line 51, in __iter__
    value = getattr(self, key, None)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/styles/", line 91, in __get__
    return coll.names[idx]
IndexError: list index out of range

Comments (4)

  1. CharlieC

    Please provide some more information about what you're trying to do, ie. provide some code otherwise we cannot investigate.

  2. CharlieC

    This looks very much like a bug related to files created by LibreOffice. These files are invalid due to the incorrect use of xfId in named styles.

  3. Log in to comment