AttributeError: when change font colour in xlwings python

I want to change font colour if before row of value is same with next cell in xlwings.I try with “worksheet.range(changeFontCell).api.font.Color = rgb_to_int((176,176,176))” to change font.

But i get error “AttributeError: ‘<win32com.gen_py.Microsoft Excel 16.0 Object Library.Range instance at 0x2163906949584>’ object has no attribute ‘font’” Below is my source code. How can i solve that error

            lastRow = worksheet.range('A' + str(worksheet.cells.last_cell.row)).end('up').row + 1
            startNewRow = 'A' + str(lastRow)

            worksheet.range(startNewRow).value = finalResult
            
            finalLastRow = worksheet.range('A' + str(worksheet.cells.last_cell.row)).end('up').row
            
            for i in list(range(lastRow, finalLastRow)):
                if worksheet.range('A' + str(i)).value == worksheet.range('A' + str(i+1)).value:
                    changeFontCellColour = 'A' + str(i+1)
                    worksheet.range(changeFontCellColour ).api.font.Color = rgb_to_int((176,176,176))
                else:
                    continue

Any advice helps! Thank you

Answer

Now i solve my problem with below source.

lastRow = worksheet.range('A' + str(worksheet.cells.last_cell.row)).end('up').row + 1
            startNewRow = 'A' + str(lastRow)

            worksheet.range(startNewRow).value = finalResult
            
            finalLastRow = worksheet.range('A' + str(worksheet.cells.last_cell.row)).end('up').row
            
            for i in list(range(lastRow, finalLastRow)):
                 if worksheet.range('A' + str(i)).value == worksheet.range('A' + str(i+1)).value:
                    changeFontCellColour = 'A' + str(i+1)
                    **myRange = worksheet.range(changeFontCellColour)**
                    myRange.api.Font.Color = rgb_to_int((160,160,160))
                    continue
                else:
                    continue