openpyxl 2.6 does not preserve conditional formatting

Issue #1186 resolved
Tadej Borovšak created an issue

Summary

When loading the workbook that contains cells with multiple conditional formatting conditions, only the last one seems to be loaded.

How to replicate

  1. Download attached xlsx file that has a cell with 2 conditional formatting conditions.
  2. Load and save workbook using openpyxl.

Expected outcome

Newly saved file has the same conditions as the original.

Actual outcome

Newly saved file contains only last condition.

Minimal example that demonstrates the issue

import openpyxl
wb = openpyxl.load_workbook("test.xlsx")
wb.save("newtest.xlsx")

Notes

This same procedure works with latest openpyxl 2.5.x.

Comments (2)

  1. Log in to comment