请问如何解决,能让写入数据新文件保持原模板设置的条件格式的负值数据条
负值数据条失效了
这个在哪里可以体现出来,
没从截图中看到相关信息,可以标注下吗
目前来说这个功能没你想的那么完善,不建议直接python操作excel可视化这块。如果要做建议用power BI 去搞或者用基础excel。
看看代码是否负值选错了颜色
>>> wb = load_workbook('document.xlsx')
>>> # Need to save with the extension *.xlsx
>>> wb.save('new_document.xlsm')
>>> # MS Excel can't open the document
>>>
>>> # or
>>>
>>> # Need specify attribute keep_vba=True
>>> wb = load_workbook('document.xlsm')
>>> wb.save('new_document.xlsm')
>>> # MS Excel can't open the document
>>>
>>> # or
>>>
>>> wb = load_workbook('document.xltm', keep_vba=True)
>>> # If us need template document, then we need specify extension as *.xltm.
>>> # If us need document, then we need specify attribute as_template=False.
>>> wb.save('new_document.xlsm', as_template=True)
>>> # MS Excel can't open the document