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 = wb.active

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

wb.save("test.xlsx")

Comments (5)

  1. Log in to comment