I am working on a excel based automation that is currently using Vlook up formula
the process is like this :
Excel 1 (sheet1)is shared that i filter as per the need and now the DT that i have i want to add 2 new column in that let it be set1 and set2.
and its comparison using subacc to check difference in qty if no diff then Qty and Set1 will have same quantity value if not then the value that is there is sheet2 and Set2 will update as match and mismatch value accordingly
If your ultimate goal is to have vlookup in the same file and store the result in the same file, I would suggest to use excel formula.
Use Excel Application Scope inside it use Use Excel file activity then inside it use write cell activity to write the excel formula to vlookup using Write Cell activity.
Then us Fill Range activity to fill the formula till the end.
Read both Excel files into DataTables dt1 and dt2.
Add two new columns to the first table. (Use Add data column activity)
Use LINQ to find matching records in the second table based on SubAcc, copy Qty to Set1, and mark Set2 as Match or Mismatch.
Linq :
DT1.AsEnumerable().ToList().ForEach(Sub(r)
Dim m = DT2.AsEnumerable().
FirstOrDefault(Function(x) x(“SubAcc”).ToString = r(“SubAcc”).ToString)