Reputation: 580
I have an issue with openpyxl library.
Problem:
When I used xlwt, opened an .xls file, and wrote some cells in there, the styles of cells I didn't touch remained the same. But now I have to work with xlsx documents, so I chose openpyxl for this. But after saving it with a .save function, it completely strips the style of a document, even the cells I didn't touch at all.
Any suggestions on how I can preserve the style?
Upvotes: 2
Views: 6677
Reputation: 51
I don't think openpyxl solved this issue yet. You can try pywin32 to directly interact with windows API with Excel, you can do everything there you want.
Upvotes: 1
Reputation: 1167
I'm having this exact problem, apparently there is no good way to preserve the styles in openpyxl, see Use openpyxl to edit a Excel2007 file (.xlsx) without changing its own styles?
Upvotes: 3