You are using delete row inside for each row activity which wont work
once evrything is done
before writing it to excel
use Remove Duplicate Row activity
and Write it
Do one thing use the Write Range at the end with Remove Duplicate rows,
Do not use with in the loop, any how operation is in Datatable so use at the end
or use this dataTable new_dt =
old_dt.AsEnumerable().GroupBy(Function(i) i.Field(Of String)(“columnWithDuplicateValues”)).Select(Function(g) g.First).CopyToDataTable