Handling MACRO using UiPath

I’m trying to highlight the excel rows using macro comparison in UiPath but when execution terminates the highlighted part get erased.

@psuryawanshi

Welcome to the community

Are you saving the file after the run…

Check the save file in the use excel scope

Cheers

Hi

There could be two reasons

  1. Either the file is in read only mode
  2. Or it is not getting saved

If it’s getting saved then it is not in read only mode
Validate this once and let us know for further clarification

Also make sure the process of colouring is not interrupted by other flow with macro script

Cheers @psuryawanshi

Hi @psuryawanshi

When you highlight Excel rows using a macro in UiPath, the highlighting is often temporary and might get erased when the execution terminates or when you close and reopen the Excel file. This is because the macro is typically applied as a visual formatting change in Excel, but it’s not saved as part of the actual Excel data. To make the highlighting permanent, you can consider one of the following approaches:

In your VBA macro, after applying the highlighting, add code to save the Excel file. This will save the changes, including the highlighted rows, to the file. Here’s an example VBA code snippet:
’ Your code to highlight rows

’ Save the Excel file
ThisWorkbook.Save

Thanks!!