IndexError while load_workbook() a just-save()ed xlsx
*Created originally on Bitbucket by [smdsbz (Xiaoguang Zhu)](https://bitbucket.org/%7Bcfa2c5ac-6ea6-476e-9029-8edc5657b165%7D/)* using Python_3.5.2 with openpyxl_2.4.2 (without PIL/Pillow, only deal with texts) on Ubuntu_16.04 I get an IndexError while tempting to open a just-created xlsx which WAS 6.7KB. I open it (with WPS Spreadsheets), ctrl-s and exit (yes, I did nothing but ctrl-s), the file is now 8.9KB, and now I can load_workbook() it without getting an error. (cells contain Chinese but I don't think that's where the problem lies...) lines I use to generate the xlsx: ``` #!python def newFile(title="测试测试", depart="其他", *, date=str(datetime.now())): ''' derive a new .xlsx from ./score-sheets/template.xlsx ''' filename = title + ' - ' + date + '.xlsx' dst = os.path.join(FOLDER, filename) try: wb = load_workbook(os.path.join(FOLDER, 'template.xlsx')) except IOError: return 0 else: ws = wb.get_sheet_by_name(wb.get_sheet_names()[0]) ws.title = title ws['B1'].value, ws['F1'].value, ws['J1'].value = title, depart, date with sqlite3.connect(DATABASE) as database: cursor = database.execute("select name from test where depart = '%s'" % depart) names = cursor.fetchall() for i in range(len(names)): ws['A'+str(i+3)].value = names[i][0] wb.save(dst) return 1 ``` debug page created by Flask indicates something related to the stylesheet which really confuses me (might be helpful): ![Screenshot from 2017-02-03 16-24-46.png](https://bitbucket.org/repo/RMdExx/images/1436150347-Screenshot%20from%202017-02-03%2016-24-46.png) contents in the xlsx file: ![Screenshot from 2017-02-03 16-28-36.png](https://bitbucket.org/repo/RMdExx/images/2840115581-Screenshot%20from%202017-02-03%2016-28-36.png) sending you the 6.7KB xlsx... *Attachments:* [aaaaaaa_-_3_February__2017.xlsx](/uploads/2c846bdd61764ba6734d6812c24bb6fb/aaaaaaa_-_3_February__2017.xlsx)[template.xlsx](/uploads/bb28bad9f8c85440319acbb3b8632c31/template.xlsx)
issue