BUG: conditional formatting gets altered / removed on read operation from xlsx
I am using openpyxl
for many years, now. And I am very happy about such a great and helpful package. But there is still one thing which bothers me alot:
openpyxl alters the contents of an xlsx file even though I only read
the file
In paticular, when I read an xlsx file using the current version 3.0.10
of the openpyxl
package, some conditional formatting configurations stored within the xlsx file get lost while others don't:
- ~"only format cells when the
cell value
isequal to
..."
will be kept as-is on file load. and stays the same after file save. Which is great. But,
- ~"only format cells containing
specific text
,starting with
..."
will be removed from the file on load, showing the message
\lib\site-packages\openpyxl\worksheet\_reader.py:312: UserWarning: Conditional Formatting extension is not supported and will be removed
QUESTIONS
Wouldn't it be possible to just keep any conditional formatting configurations on a load operation and save it as-is, if no modification was done aiming ath those configurations? If so, we could prepare xlsx template files containing desired conditional formatting configurations, then read them by using openpyxl
and then fill in just textual cell contents, save the file and done.
What is the technical reason for modification of existing conditional formatting configurations while doing a read operation? why not just keeping it the way it is and save it without touching those configurations?
Thanks.