Get filled Color of Cell in openpyxl

Viewed 41

I need to have the color value of a cell in Excel with openpyxl and Python.

I already tried

    excel_file = 'DiffMerge_Abschätzung_3e2_extern.xlsx'
    wb = load_workbook(excel_file, data_only=True)
    sh = wb['Abschätzung SD']
    color_in_hex = float(sh['A5'].fill.start_color.index)
    print(color_in_hex)
    print(sh['A5'].fill.start_color.index)

My Excel sheet has a grey background and it does only print 0 at a grey background color. So my question: Is there a way to convert the color or to get a other format about the color from the openpyxl module?

0 Answers
Related