Append Range - An item with the same key has already been added


I am merging a file into an existing file then suddenly ran into the error below.

“An item with the same key has already been added”

Note that I am using Append Range to merge the files. Upon checking, the data will be inserted to the existing file but the bot will stop and produce the error. I have tried


@caduque Seems to me that your Excel File cannot have duplicate values. Is the Excel File configured in that way or is it just a normal Excel File. If possible can you share it, and explain what you are trying to do exactly?

Hi @supermanPunch,

See attached. So I have this merged data table that I have to append in the attached file, in the Test tab of the excel.WorkForce Mgmt Template.xlsx (1.6 MB)

@caduque Can you try using Append Range on another Excel File, and check if the Problem exists in that as well?

I’ve tried to append it on a blank excel file and it worked! But this particular file that I have sent you has some important formulas so I still need to use it. You have any thoughts for a workaround?

@caduque Look Like the File is the Problem after all, Are you using Excel Application Scope or the WorkBook Activity?

I can send you my xaml file on how I merged my files then insert it into a the file I sent you

But I have to change some data for confidentiality

@caduque Yes Sure. If you can provide it please do. Others might have already encountered and would know how to solve this problem as well. But make sure that you are trying with both Excel and Workbook activities first.

Here it is. Dont mind the errors, I didnt declare all the variables coz I just transferred this from the original xaml.

Main.xaml (10.6 KB)

@caduque Can you check if the Excel Process is still present in the Task Manager, if it’s open, Kill the Tasks, and check the Process using only Workbook Activities. Do not use Excel Scope. Can you try this and check.

The files Im processing are under .xls extension. I am encountering errors whenever I use the other Read Range activity.

@caduque ok. In that case, since you are just reading the Excel Files and not Modifying it, you can change it’s properties to Read Only and disable other Properties.