Workarounds For Excel Scope Write Range Error In Filtered Or Hidden Sheets

Why the Excel Scope Write Range activity throws an error when there are filtered or hidden cells?

UiPath throws an error informing the user to unhide / unfilter cells before writing to desired range.

The decision was made because of the drawbacks / risks of fixing a known error of writing the wrong values into the specified range when there were filtered / hidden cells. The drawbacks include and are not limited to introduction of complex code, decreased performance, lack of clarity of what data gets overwritten. The decision to inform the users through throwing an exception was applied starting from Excel.Activities package version 2.8.5.

It is observed that versions 2.7.2 and earlier do not throw an error on running the activity. However, it does not write correctly. This can be easily verified by creating a simplified excel file with only 3-4 rows and 3-4 columns.

There are 2 workaround for this:

  1. Use the Workbook Write Range activity instead of the Excel Scope Write Range activity (this works without errors and also writes correctly).
  2. Unfilter and unhide all columns and rows for Excel files that need to be written into using Write Range.

In my project i used Workbook Write Range but after that a excel scope activity is used after some delay but excel gets stuck unless we make it visible and click on it so as work around we used for each inside the excel scope to write the data into each cell incrementing when and where required and it works fine without excel getting stuck after workbook activity and excel scope simultaneously used one after the other.