Excel Append Range, does not append at first blank row

Hi, I am using Excel Append Range activity to append a DataTable to the first empty row in an Excel sheet. This DataTable only has one row.

However, instead of filling the first blank row (i.e. Row 2), it appends the DataTable to somewhere further down e.g. Row 5,6,7… etc.

How do I fix this? I have tried clearing contents, saving, closing and reopening the file. I even deleted the entire worksheet and re-added the headers.

This worked at first, but then I cleared the contents and ran the workflow again, cleared it again and run the workflow a second, third time etc. When I did this, the row which UiPath added the DataTable started shifting one row down per iteration e.g. it started appending at Row 3, then Row 4, then Row 5 and so on… Each time I ran the workflow it shifts one row down, as if the row of data I added was never cleared.

How do I fix this?


You can use Readrow and get the row count before appending. It will give the number of rows. Then append the data based on the last row.