Write data table to excel, data table keep replacing


I tried to export a data table to excel using Write Data Table to Excel. There are more than hundreds of data needed to be saved to excel. When my query is done running and I tried to write line, the data are successfully outputted as I expected, but when I write it to data table, it just keeps replacing at the same cell. I tried 3 solutions I can do :

  1. Check append on write data table and I got error like this :
  2. I tried to use append range. But the question is, how do I fill the “Excel Range to Append” when the number of data table itself changing depends on the database?
  3. Tried to pass it into Add Data Row, and I got an error :

Add Data Row: Cannot set column ‘Column_Name’. The value violates the MaxLength limit of this column.

Any solution for this? I need help for this urgently

Hello @Rhys18

I think you have enquired this earlier also.
Did you tried removing the Range(“A:B”) and execute once.


Can you please let me know which cell keep on replacing

FYI - in Write data table to excel activity you have mentioned the Range as (A:B). I guess its not the right way of passing range. It should be like (A1:B1)


my bad I forgot about the thread. I found the solution and I will post it below


I found the solution, assign a variable in the index as seen below to output the data, and write it in the data table like this :


This case on me are outputting the data table after doing a query inside the uipath, so theres 2 things to do :

  1. Assign counter = counter + 2 so the data table will be outputted at Row 2 of the excel (Row 1 is used as header)

  2. exclude the header is must checked and all data table will be outputted to excel. The header can be declared manually in excel and use it as template

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