You piqued my interest so I had a look at how simple this might be to achieve. It is actually really simple in coding terms so might not be much of a risk to have it as a code stage after all. Your code stage will need to have the following inputs:
handle of the excel instance
workbook name
the range you want to filter
In my example I have called these handle, workbookname and filterrange (note the lack of spaces in the parameter names - this is deliberate as the code stage will not be able to handle any names with spaces).
In the code stage itself, you then need to assign an object to the workbook and perform the advanced filter to unique values:
Dim wb as Object = GetWorkbook(handle,workbookname)
wb.Activesheet.Range(filterrange).AdvancedFilter(Action:=1, Unique:=True)
NB: The 'Action =1' replaces 'Action:=xlFilterInPlace' due to the fact that Blue Prism doesn't hold all of the Excel Object Naming Conventions and we need to use the numerical identifier instead.
I hope this makes sense. unfortunately, I won't be able to share the actual Blue Prism code stage I have built as I only have Blue Prism on my work machine.
If you have any questions, let me know and I will try to help further.
------------------------------
Humphreys
Senior Technical Specialist
Europe/London
------------------------------