Excel Remove duplicates like for Collections using code stage

Dav3D

New Member
Hi, I have the following situation: a collection with 7 columns and variable number of rows. I would like to remove duplicate rows by only consider 2-3 of those columns, exactly as it is done by Excel.
I would like to avoid writing the collection to Excel, use VBA code and get it back to BP, so I've heard about using Code stage and Microsoft.Office.Interop.Excel.XlYesNoGuess, is there a way I can mimic the action directly into BP? Thanks in advance.

P.S.: Please notice I have read most of the answers to similar problems, but I want to mimic the exact Excel functionality (including headers), and if possible, not have to concatenate or loop thru the collection to avoid performance issues (I need to process around 25 tables in a short period of time).
 

VJR

Well-Known Member
Hi Dav3D,

The Microsoft.Office.Interop.Excel.XlYesNoGuess is a parameter to the Range.RemoveDuplicates method to achieve interoperablity with a Range of data in an Excel application. So this will make use of having the data to get into an Excel sheet from a Collection and then removing the duplicates (using the above method) via a Code stage and then posting back the data to a Blue Prism collection. Let me know if you would want to explore this approach.
 

Dav3D

New Member
Thanks a lot VJR. I had to solve this a while back the hard way by pasting data in Excel, running a macro and reading it back.
If I come accross a similar requirement in the future, I will five rhis a try as it seems much more easier (at least avoids to run a macro).
 
  • Like
Reactions: VJR
Top