Append range is not working clearly after using clear sheet

Hello Guys,

I hope everyone is having a good day, i needy your help,

I am using append range activity to append the values in excel.
To write a data to the excel i have template on it. before i am using append range activity i have to clear the data in that sheet without header (header is the template).
I Used the below flow

  1. clear sheet/range/table activity to clear data
    2.read range
  2. for each row in a data table
    • process data
    • add data row
    • append range activity

while using clear range it did cleared the data on it, but in append range it write it from the last row which is empty.

for example,

Can someone help me with to write the data properly from the 1st row.

Thanks,
Soundarya

@soundarya_A1

in clear range we have to give full row not liek A2:H11 but like 2:11

also instead of clearing and using always…have a template and copy that and use it whenever you need…thsi way the template is fresh and extra steps of clearing all all would not be there

cheers

1 Like

@Anil_G Could you please explain me more on it?

@soundarya_A1

  1. Create the template with headers and say store it in temp folder inside data folder in the project itself…
  2. When you need to use the template…use a copy file and create a copy of the template in the location you need and then append the data

this way you need not use clear range always

hope this is clear

cheers

but the excel contain some other sheets in it, i tried with copy sheet but it doesn’t work, if i tried to run again.

@soundarya_A1

have all the sheets in your template

also what is the problem with copy sheet can you please elaborate

also as mentioned try 2:11 to clear sheet by giving row numbers directly instead of column names

cheers

Source: Copy Sheet

Message: That name is already taken. Try a different one.

Exception Type: System.Runtime.InteropServices.COMException

this is the error while i tried to use copy sheet when i tried to re-run the bot

@soundarya_A1

Thats is because the same sheetname already exists

cheers