Excel Write cell activity time increases after every record inserted in a loop


When i enter data into Excel file using Excel Application Scope or System Workbook, Write Cell Activity.
So the process is:
There are 100+ records are scrapped from webpage and stored in an Datatable.
Now this DT data is processed one by one using For each row activity.
So first record took 10 seconds,
2nd record is also taking approximately 10 seconds
28 or 29 or 30th record it takes 2-3 minutes
and each and every record after is takes 4+ minutes and the time keeps on increasing for other remaining records.

Just want to know is it normal with UiPath Studio or process or
Is there any way to mitigate or work around to work with Write Cell for more than 100+ records.

Anil Kumar

Use build data table instead. And every time you need to write the add them to the build data table using add data row activity to which input will be the variable of build data table.

Loop this using for each or while loop.

At the end use write range activity. Instead of write cell activity. I think that will take not more than few seconds.

Hope that helped.

Ashley Nihal Dcunha

Buddy @Anil_choudhary

if you are obtaining the scrapped datatable from webpage and it is of type datatable…we can directly use write range activity to enter that to a excel file buddy, why write cell buddy
are you trying into enter into any specific cell in a excel buddy …?

Cheers @Anil_choudhary

Well the issue is:

I have a master excel with some Port names (500+ records)
Now I m scrapping the port charges or other charges from different websites (Usually 20-50 or less than 100)
So I put this scrapped data into a Dt.
Loop through this DT and find the port name from master Excel, get the port cell (Say B123), not I will remove B and write into C123 and so on.
So for next port it will be say B234 and i will write the charges against C234.

So i can’t use write range i need to deal with Write Cell only.


Hello @Anil_choudhary instead of updating master after each cell match you can do below…

scrapped datatable = dt
master datatable = masterDt

for each row in dt

for each row2 in ( from row in masterDt.rows where row2(“PortName”) = row(‘PortName’) select row ).ToList — < just in case master if master file contains portname multiple time>
row2(“Charges”) = row(“Charges”)