DATAROW[] write back to EXCEL

After selecting DATAROW from EXCEL, how to write back to EXCEL after modifying the contents in DATAROW at once.Not by loop, thank you .

1 Like


You can convert DataRow array into DataTable like below:

newDT = DataRow[ ].copyToDataTable

Then use Write Range activity to write into excel and pass that dataTable.

1 Like

Buddy @yifan

Welcome to uipath community buddy…

Once you make any changes with the datarow, you can add with add data row activity with datarow as input or even the array of row you want to enter to the datatable…

Use Write range activity to enter that modified datatable to the excel you want buddy

This xaml could help you buddy
add_data_row.xaml (7.7 KB)


Is that working buddy…

For example, EXCEL has 10 rows, while the selected datarow only contains 2, 5, 6 and 8 rows. I modified the value of the second column of each row of datarow, and then overwrote it back to EXCEL. The total number of rows in EXCEL is still 10 rows, I don’t know whether I can express it clearly.I want to write the modified datarow back into the old EXCEL all at once, and the value of the second column of the corresponding row becomes the new value.
I don’t want to do the same thing that I did in the lecture, which was to loop through and over and over and over again write into EXCEL, which is very slow

Write Range doesn’t work because the rows aren’t continuous

Buddy you can use invoke method to insert the row at any position you want
like this

Set the Object with the datatable variable like out_dt.Rows
and set the method like InsertAt
and pass the parameter with the datarow as oneinput and the position in integer as another input


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