Cell format is lost when writing data
I have a template excel file, containing colored empty cells. When I write date to the cell, the color is lost.
As a woraround I tried to back up the format before writing the value and then apply the fill. Unfortunately, that did not work.
fill = cell.fill.copy()
font = cell.font.copy()
cell.value = column_name
cell.fill = fill
cell.font = font
Please fix the writing of the data to keep the format.
Related:
https://stackoverflow.com/questions/36986351/preserve-original-cell-formatting-in-openpyxl
Edited by fhgisi