The sheet name already existing problem

We have one excel sheet, it contains many buyer name Column with Many buyer name in repeated times. We filtered the buyer name and stored into same excel another sheet. We given a sheet name as Buyer Name. After that using Add Sheet Activity to create sheet. For first time its working fine and created the sheet with corresponded buyer name. Then after repeated the buyer name, its getting (already sheet name was existed) . How to resolve this error.

1 Like

Hi @shanmugapriyag ,

We will not be able to add two sheets with the same name. But for your case, it seems that if the sheet is already added, then you can append the data to the same sheet instead of copying the sheet.

Thanks for your reply,
We tried append range activity also. But it not added the data in same sheet. It getting error only (Already sheet name exist).

@shanmugapriyag ,

Could you maybe show us the Implementation that was done ?

@shanmugapriyag ,

Maybe we can handle this by taking the unique data at the beginning. Row("Buyer Name").ToString is seen in the SheetName property, Could you let us know from where do you get this ?

We would need to Take only the Unique Buyer’s Name and then loop over it, so that it will filter once the Data corresponding to it and the sheet name will only needed to be created once.

Hope the Logic required is the same. Let us know after you analyse the above suggestion for your case.

We used For each row in data table activity to loop through the process. Its getting the value is [Row] and Buyer name is the column name of excel file.

@shanmugapriyag ,

Could you show this Implementation as well using a Screenshot ?



@shanmugapriyag ,

After the First Read Range, use the below Expression in an Assign activity :

UniqueBuyersDT = vDT1.DefaultView.ToTable(false,"Buyer Name")

You would need to create a Datatable variable with the name UniqueBuyersDT.

Next, Use this new datatable in the For Each Row in Datatable activity.

You also, wouldn’t need to have the Append Range activity, only the Write Range activity.

Let us know after making the above changes if you are able to get the required output.

Okay. I will try to follow this steps and make an update.

I done a same way. But the excel file, data was not added. It also shown an error.


@shanmugapriyag ,

Apologies. You would need to use the below Expression :

UniqueBuyersDT = vDT1.DefaultView.ToTable(True,"Buyer Name")

false should be changed to True.

Thank you for your reply,
I tried to changed False into True. But same issues only shown. It’s not added the data in excel.