Unable to Extract Cell Colors with RGB Values

52 views
Skip to first unread message

Gaurav Nandode

unread,
Jul 31, 2024, 7:04:13 AMJul 31
to openpyxl-users

I am trying to extract cell colors from an Excel file using openpyxl with the fill.start_color.index attribute. I encounter the following issue:

If a cell color has its RGB value explicitly set using the 'Fill Color' option in MS Excel, I can extract the RGB value without any problem. However, if the color is pasted from another source or the RGB value is not explicitly set in the 'More Colors' option under 'Fill Color', I am unable to retrieve the RGB value using fill.start_color.index. Could you please provide guidance on how to reliably extract RGB values for cell colors, regardless of how the color was applied?

Reply all
Reply to author
Forward
0 new messages