openpyxl单元格样式无法正确报告 [英] openpyxl cell style not reporting correctly

查看:85
本文介绍了openpyxl单元格样式无法正确报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用python库 openpyxl ,我正在读取在excel 2007中创建的XLSX文件.除单元格A1外它是黄色的,上面写有"test"值,它是空的.我可以轻松地从该单元格中检索值,但是当我尝试确定填充色时,我得到以下结果:

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 

返回"FFFFFF"

returns "FFFFFF"

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

返回"FF0000"

returns "FF0000"

在其他空白单元格上对此进行测试,我得到的结果完全相同,并且尝试检索字体样式信息时,始终会返回calibri size 11(我们的系统默认值).

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.

谢谢!

推荐答案

Openpyxl仍在开发中,样式尚未完全实现,因此您可能会在这里和那里遇到一些问题.如果愿意,请随时在项目错误跟踪器上打开问题.

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.

这篇关于openpyxl单元格样式无法正确报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆