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 "crawl.py", line 159, in <module>
    wb.save('eir_April2016_copy.xlsx')
  File "/usr/local/lib/python2.7/site-packages/openpyxl/workbook/workbook.py", line 339, in save
    save_workbook(self, filename)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/excel.py", line 268, in save_workbook
    writer.save(filename)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/excel.py", line 250, in save
    self.write_data()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/excel.py", line 81, in write_data
    self._write_worksheets()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/excel.py", line 199, in _write_worksheets
    xml = ws._write()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/worksheet.py", line 851, in _write
    return write_worksheet(self)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/writer/worksheet.py", line 99, in write_worksheet
    cols = ws.column_dimensions.to_tree()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/dimensions.py", line 230, in to_tree
    obj = col.to_tree()
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/dimensions.py", line 182, in to_tree
    attrs = dict(self)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/worksheet/dimensions.py", line 51, in __iter__
    value = getattr(self, key, None)
  File "/usr/local/lib/python2.7/site-packages/openpyxl/styles/styleable.py", 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