14-07-25 06:59 PM
I am trying to filter a column in the excel file using action - "Add criteria to auto filter blue prism". It is one of the actions in MS Excel VBO - Extended Digital Exchnage. I need the criteria to be able to filter any value greater than zero. I am able to just provide a value with this criteria here. for example, if I set criteria to zero, it will filter the excel with value zero for that column. But I need to filter on anything gretaer than zero so that all negative or zero values are eliminated. Is there a way to give different value to criteria. Please suggest.
Answered! Go to Answer.
15-07-25 12:19 PM
Hello @poojagupta83,
Auto Filter in Blue Prism’s MS Excel VBO (including the Extended version) is limited when it comes to using conditions like greater than ( > ) or less than ( < ) for numeric filtering. The “Add Criteria to Auto Filter” action primarily works for exact match filtering or basic text wildcards (like *keyword*), but unfortunately, it doesn’t support operators like >0 directly — this is a limitation of how AutoFilter criteria are passed through the VBO actions.
However, you can definitely achieve this using a Code Stage with VB.NET, where you can access Excel’s full object model via Interop and apply filters with conditions like >0 without any restrictions. This approach offers much more flexibility and keeps everything within Blue Prism without needing external macros.
If you’d like, I can share a sample Code Stage snippet you can directly use to apply the greater than zero filter in your process. Just let me know!
15-07-25 12:19 PM
Hello @poojagupta83,
Auto Filter in Blue Prism’s MS Excel VBO (including the Extended version) is limited when it comes to using conditions like greater than ( > ) or less than ( < ) for numeric filtering. The “Add Criteria to Auto Filter” action primarily works for exact match filtering or basic text wildcards (like *keyword*), but unfortunately, it doesn’t support operators like >0 directly — this is a limitation of how AutoFilter criteria are passed through the VBO actions.
However, you can definitely achieve this using a Code Stage with VB.NET, where you can access Excel’s full object model via Interop and apply filters with conditions like >0 without any restrictions. This approach offers much more flexibility and keeps everything within Blue Prism without needing external macros.
If you’d like, I can share a sample Code Stage snippet you can directly use to apply the greater than zero filter in your process. Just let me know!
15-07-25 02:59 PM
Hi Sourav,
Thanks for responding. It will be helpful if you can share the sample Code Stage snippet.
Pooja
16-07-25 03:24 AM - edited 16-07-25 03:28 AM
Plase find the details below, i have tested for both >0, <0 conditions,
Columnindex = the column number which you are trying to apply the filter(Like ColumnA =1)
Range can be A1 as we have the headers in first row always, incase you need to filter only specific range that you can provide as well (A1:F10)
filtercriteria - you can provide >,<,= (you can test for other if you want to try)
Add the action into your MS Excel VBO to use it.
Try and let me know, if it works for you.
Thanks,
Nandha
16-07-25 12:14 PM - edited 16-07-25 12:14 PM
Hi @poojagupta83,
Try the code and approach that have been provided above. It should work; if not, we can dive deeper.
16-07-25 03:44 PM
Hi,
I am getting internal error - The > operation must have 2 operands.
Below are the screen shots of my code.
Can u pls suggest.
17-07-25 02:47 AM - edited 17-07-25 02:48 AM
Hi @poojagupta83 ,
As i can see that you are giving the value to filtercriteria without "", its a text data type. also you need to provide the Range value as per your header row in the file. "A1" if the first row is header.
Try this and let me know if you are able to solve it.
Thanks,
Nandha
17-07-25 05:03 PM
Hi Nandha,
I made the changes that you suggested. I am getting issues with Range now. I have attached the necessary screen shots. I am not sure if I am missing any library here. Please advise.
18-07-25 03:15 AM
Hi @poojagupta83 ,
can you pls provide the screenshot of the excel file you are trying to filter if possible?
Can i understand the range you have provided is V5 meaning your headers in 5th row of your input file? i think you are confusing the range with column index. you have provided column index as 22 which column v then range also you have provided range as V1.
Range:
If your headers in first row give the value as A1.
Thanks,
Nandha
21-07-25 04:40 PM
Giving the Range "A1" worked for me. Thanks a lot for helping with this.