Skip to content Skip to sidebar Skip to footer

Openpyxl Fills Adjacent Cells

I came across a very peculiar thing. When I try to fill a cell in an excel worksheet with a solid colour it fills adjacent cells, sometimes even dozens. It's odd since I do exactly

Solution 1:

I've looked into this a lot more. If you're facing a similar issue please follow this question of mine which describes the causes for the above problem. As of now this is a known issue in openpyxl and some people are working on fixing this. So hopefully this bug (because it has been confirmed to be cause by a bug in the library) will be fixed soon.

What I can suggest to try and alleviate the problem is to always select only one cell which is not filled using openpyxl later when saving the workbook in Excel. Also try not to touch the formatted cells too much through Excel itself, just openpyxl. And if you do change the cell format through Excel make sure you only change one cell at a time - if you apply the same style to a range of cells the same range will be then changed when you format a cell using openpyxl.

As unsatisfactory as it is to me that's all I've heard of the authors and figured out myself so far.


Post a Comment for "Openpyxl Fills Adjacent Cells"