Applying fill to cell with a NamedStyle applies fill to all cells with NamedStyle

Issue #765 resolved
AlainPannetier created an issue

Simple test:

#!/usr/bin/env python3

from openpyxl import Workbook
from openpyxl.styles import NamedStyle, PatternFill, fills

myStyle = NamedStyle(name="myStyle")

wb = Workbook()
ws =

ws['A1'].value = 'A1'
ws['A1'].style = myStyle
ws['A2'].value = 'A2'
ws['A2'].style = myStyle
ws['A1'].fill = PatternFill(fill_type=fills.FILL_SOLID, fgColor='ff0000')
# Result ==> A2 has red background too"test.xlsx")

Comments (6)

  1. Log in to comment