How to add color to Excel cells(A2)

Hi All,

I would like to highlight the some of Excel Cells, As per below screen. Please help me how can i highlight the “A2” Cell in Excel.

Thanks in Advance,
Niranjan

i think you missed to add the screen you mentioned. But you can use set range color activity

You could also use excel VBA

1 Like

Hi @Niranjan_k

Use can use Invoke VBA activity.

Sub HighlightCell()
    Range("A2").Interior.Color = RGB(255, 255, 0)  'Yellow color
End Sub

You can add if any more cells are needed in the same way.

Paste this code in a notepad file pass this path and method name as HighlightCell.

Hope it helps!!

1 Like

@Niranjan_k

Input:


Output:

Code Text file used:
Input.txt (94 Bytes)

Check out the workflow file for better understanding
Sequence7.xaml (7.1 KB)

Hope it helps!!

1 Like

@Niranjan_k

If you find solution for your query please mark it as solution to close the loop.

Happy Automation

Regards

@Niranjan_k

If using classic activities use set range color activity

If using modern activities use format cells activity

Cheers

Hi @Niranjan_k

You can use modern activity format cells

1 Like

@Parvathy I’m in able to open the file can you share me screenshot of workflow

Hi @Niranjan_k

Regards,

1 Like

@Parvathy for Invoke VBA I’m not getting these many options. I got only two options

hi @Niranjan_k

Are you using Classic activities. If yes specify.

Regards,

@Niranjan_k

If classic activities follow the below workflow:

Text file passed:
Input.txt (94 Bytes)

Regards,

1 Like

@Parvathy thank you for quick reply, But here I’m get ting Excel Application Scope: Error opening workbook. If Excel is installed, Run the “repair tool for Microsoft office interop’ from the tools tab on the Home Screen

@Niranjan_k

You need to have excel installed to run macro codes.

Regards,

@Parvathy Yes i did UiPath.Excel.Activities right, if not please suggest me

@Niranjan_k

Don’t you have Microsoft Excel installed in your machine.
Regards,

@Parvathy Yes I have. But still I’m same Error

Hi @Niranjan_k

Make sure you have Excel Add in installed
Home-> Tools-> UiPath Extensions

Make sure you have UiPath.Excel.Activties installed
Manage Packages-> All Packages-> Type UiPath.Excel.Activities-> Install-> Save

Regards,

1 Like

@Parvathy I have checked it is installed on my machine, another way we can fix this issue

Hi @Niranjan_k

Try this:
For this you need the dependancy UiPath.Excel.Activities


Click on Fill-> Give the respective color-> Click OK
image

Regards,