openpyxl cell style not reporting correctly

こ雲淡風輕ζ 提交于 2019-12-01 15:06:47

问题


Using the python library openpyxl I am reading an XLSX file created in excel 2007. it is empty apart from cell A1 which is coloured yellow and has the value "test" written in it. I can easily retrieve the value from that cell, however when I attempt to determine the fill colour I get the following results:

this_sheet.cell("A1").style.fill.start_color 

returns "FFFFFF"

this_sheet.cell("A1").style.fill.end_color 

returns "FF0000"

Testing this on other blank cells I get exactly the same results, and trying to retrieve the font style information keeps returning calibri size 11 (our system default).

Am I going about this all wrong? Is there an alternative method i should be using? Any help would be greatly appreciated.

Thanks!


回答1:


Openpyxl is still in development, and styles are not yet completely implemented, thus you can encounter some issues here and there. Don't hesitate to open an issue on the project bug tracker if you want.



来源:https://stackoverflow.com/questions/5560675/openpyxl-cell-style-not-reporting-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!