Conditional formatting not saved when using write-only mode

Issue #846 resolved
Cristian Ciupitu
created an issue

If I use conditional formatting rules in the optimized write only mode they aren't saved.

from openpyxl import Workbook
from openpyxl.formatting.rule import CellIsRule
from openpyxl.styles import PatternFill

redFill = PatternFill(start_color='EE1111', end_color='EE1111',
                      fill_type='solid')

wb = Workbook(write_only=True)
ws = wb.create_sheet(title='Conditional')
ws.conditional_formatting.add(
    'D2:D10',
    CellIsRule(
        operator='between', formula=['1', '5'], stopIfTrue=True, fill=redFill
    )
)
wb.save('test_write-only.xlsx')

Comments (2)

  1. Log in to comment