Write in Excel in the fastest way


I need to write in an Excel document. I try to find the best way to do it quickly.
I know the native activities :

  • Excel activities
  • Workbook activities

Now, i would like to try invoke code, I use this code :
Dim docEx As UiPath.Excel.Workbook
docEx = New uipath.Excel.WorkbookFileXls(“C:\Users\NOM\Documents\UiPath\test.xlsx”,False)
rem docEx.SetSheet(“feuil1”,False)
rem docEx.WriteCell(“B1”,“Toto”)
rem docEx.CloseWorkbook

But it doesn’t work, i don’t have error in uipath, but my excel file is empty.
Can you help me ?
(And if you have ideas to write into Excel file without opening it, i’m interessed.

Thank you !

Unless you have a really specific use case or a strong reason to use Invoke Code activity, the Excel activities can do the job quite well.
The Excel Application Scope activity has a flag called Visible under Options. You can use that to run Excel application completely in background.

As far as writing to excel in the fastest way is concerned, you can manipulate a DataTable object in UiPath any way you want and write it to Excel at the very end.
But it depends on your problem statement. If you need to work with Cell rules etc, then maybe it’s a different situation.

1 Like

Thank you for your help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.