I have concerns about the following page:
It states that "Cell styles are shared between objects and once they have been assigned they cannot be changed." I believe that this is not true, e.g., one can do the following:
from openpyxl.styles import colors from openpyxl.styles import Font, Color from openpyxl import Workbook wb = Workbook() ws = wb.active
a1 = ws['A1'] red = Font(color=colors.RED) blue= Font(color=colors.BLUE) a1.font= red a1.font= blue
(At least, it runs without generating any error).
One can even do this:
So, I'd like to suggest that the above text be reworded as follows: "Cell styles are shared between objects. Consequently, once a cell style has been assigned, attributes cannot be changed on a cell-by-cell basis. One can modify an attribute of the style, in which case this affects all cells to which that style has been applied."
Phillip M. Feldman