Find the Text color in the Excel cell

I am trying to find the cell color in the excel sheet by iterating all the rows from the Datatable.
I am not getting any idea how we can do that.
Find some video about IEnumerable but doesn’t convert Datarow to IEnumerable.
Column Name has the different colors and it has to print in the messagbox with the color name

Could you please help if there is any way to read the color.



use this below vba to get the text color

Function FontColor(ByVal Target As Range) As Integer
    GetFontColor = Target.Font.ColorIndex
End Function

Thankyou Naveen for your answer.
But I am not much familier with VBA and how to use it using UIpath.

Can’t we do it by using only Uipath?

You can get the cell color using UiPath, but we don’t have activity to get the font color.

Using VB in uipath is simple. Drag the Invoke VB code activity and write the code inside

I am able to get the font color from a cell in Excel using Uipath only without any VB.
This might work if time is not a constraint in executing the workflow.

  1. Select the cell in Excel sheet.
  2. Right click mouse and select format.
  3. Use option Select text and indicate the Color section from font.
  4. Print the output, if only color is required then use Substring method from the output.