You can also do it with Invoke Code. It is better and faster. See attached file:
Sequence35.xaml (5.4 KB)
You need to import this package to your UiPath Studio:
Microsoft.Office.Interop.Excel
Dim xlApp As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application
Try
Dim xlWorkbook As Microsoft.Office.Interop.Excel.Workbook = xlApp.Workbooks.Open(Path)'Define Excel Sheet
Dim xlWorksheet As Microsoft.Office.Interop.Excel.WorksheetxlWorksheet = CType(xlWorkbook.Sheets(“Data”), Microsoft.Office.Interop.Excel.Worksheet)
'Activate Worksheet Data
xlWorksheet.Activate()'Write Formula in Cells: F2 to F30
xlWorksheet.Range(“F2:F30”).Formula=“=VLOOKUP(E2,Supersmart!A:A,1,0)”'Save Workbook
xlWorkbook.Save'Close Workbook
xlWorkbook.CloseCatch ex As Exception
Throw ex
Finally
'Close Excel Application
xlApp.Quit
End Try
