Write DataTable activity is overwriting data in excel inside for each loop

Hello, I’m using Write DataTable Activity to write data in my excel file but instead of writing it in each row, it overwrites my existing data. My Write DataTable is inside for each loop. I’ve already look for similar solution but it does not solve it.

I’ve tried using this in my write datatable destination:

Excel.Sheet(“Search Address”).Range(“D” + (dtRef.Rows.Count + 1).ToString)

I’ve have also tried to use append range.

Try append instead of write pls


Can you share your input workbook and expected output as file?
Basically we can achieve it either the following approach.

  1. Create additional datatable and write it append mode.

  2. Add new row to the datatable and overwrite it to the original worksheet.


Sorry for the late reply

Here’s the input file:

Special Project.xlsx (847.0 KB)

Expected output should look like this:

I already tried but still my data is overwritten


FYI, the following is a sample of overwriting whole the datatable. Hope this helps you.

AutoFilterV2.zip (1.5 MB)


1 Like

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