cancel
Showing results for 
Search instead for 
Did you mean: 

Help with code stage to find value from Excel column (exact match)

JariKorkkinen
Level 3
Hello, I have a process where I have to find certain value from Excel sheet´s column, select the cell and write data to that row. Worksheets are very large (tens of thousands rows) and it would be too slow to achieve this with BluePrism´s standard Excel VBO actions so I have created a new action for search. This works well except this returns also partial matches.  Eg. If I search 12345, this considers 1234567 as a match which is wrong. Here is the code [inputs CTS = column to search (number), FIND = value that is searched (text)]: -------------------------------- Dim worksheet As Object Try worksheet = GetWorkbook(handle,Nothing).ActiveSheet worksheet.Columns(CTS).Find(FIND).Select Success = True Catch e As Exception Success = False End Try ---------------------------------- I tried to alter code to return exact matches only but this didn´t work. This doesn´t find anything.   Dim Excel As Object Dim worksheet As Object Dim wb As Object   Try wb = GetWorkbook(handle, nothing) worksheet = GetWorkbook(handle, nothing).ActiveSheet Excel = wb.Application   worksheet.Columns(CTS).Find(what:=FIND, LookAt:=Excel.xlWhole).Select   Success = True Catch e as Exception Success = False   End Try ------------------------------------- Would here be a vb.net wizard who could see what is wrong in the code and help how to get this working correctly?   Br, Jari
2 REPLIES 2

Denis__Dennehy
Level 15
Have you tried using the OLDEB VBO to access and manipulate your Excel workbook using SQL?

JariKorkkinen
Level 3
Hi Denis, Thanks for a tip! I am not familiar with OLEDB so I have to study that and see if that would be a good option to handle massive Excels in the future. Still I´d like to find solution to my code problem because otherwise this code works very well.   Br,   Jari