Duplicates in excel



I am practicing having UiPath read a large excel file before I break up the data. Within the excel file there are duplicate names and company names. When I run the bot I get an exception where it says

Source: Read Range

Message: A column named ‘Red Company’ already belongs to this Datatable.

ExceptionType: Dublicate NamesException

Does anyone know how to fix this?




Do you have two headers with the same name ‘Red Company’? In a DataTable it is not possible to have columns with the same name.


A column named already belongs to this datatable

Hi @Cormac,

Use Read Range activity to get get as Data Table (Uncheck the Add Header Properties)
create array Variable arrHeader


check if condition arrHeader.Length = arrHeader.Distinct().Count()
True->No Duplicate in the Column Header.
False->Duplicate in the Column Header.

Arivu :slight_smile: