Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openpyxl cell style not reporting correctly

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!

like image 615
danspants Avatar asked Apr 06 '11 01:04

danspants


1 Answers

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.

like image 53
Eric Gazoni Avatar answered Nov 04 '22 16:11

Eric Gazoni