writing to sheet1, sheet2, sheet1, etc
Created originally on Bitbucket by ccurvey
I'm not sure if this is a bug or if it is expected to work. I'm trying to take the results of a query and write them to different sheets based on some attribute of the rows. (A test program that tries to write out even and odd numbers to different sheets is attached.) When I try to save, I'm getting an AttributeError.
Here's the stack trace -- I'm having trouble formatting it correctly.
AttributeError: 'str' object has no attribute '_styles' File "c:\Users\ccurvey\augean\sheetplay.py", line 15, in book.save(r"c:\temp\foobar.xlsx")
File "c:\Python26\Lib\site-packages\openpyxl-1.5.2-py2.6.egg\openpyxl\workbook.py", line 186, in save save_workbook(self, filename)
File "c:\Python26\Lib\site-packages\openpyxl-1.5.2-py2.6.egg\openpyxl\writer\excel.py", line 140, in save_workbook writer = ExcelWriter(workbook) File "c:\Python26\Lib\site-packages\openpyxl-1.5.2-py2.6.egg\openpyxl\writer\excel.py", line 53, in init self.style_writer = StyleWriter(self.workbook)
File "c:\Python26\Lib\site-packages\openpyxl-1.5.2-py2.6.egg\openpyxl\writer\styles.py", line 36, in init self._style_list = self._get_style_list(workbook)
File "c:\Python26\Lib\site-packages\openpyxl-1.5.2-py2.6.egg\openpyxl\writer\styles.py", line 43, in _get_style_list for style in worksheet._styles.values(): }}}
Attachments: sheetplay.py