Posted 22 July 2020, 9:49 am EST - Updated 29 September 2022, 6:38 am EST
I have a strange behavior with this code:
worksheet.Rows[19].Value = new[] {"TableHeaderColumnName", "TableHeaderColumnName"};
worksheet.Tables.Add(worksheet.Range[$"A{20}:B23"], true);
In the Excel file generated the value of the second element of the array is changed automatically to: TableHeaderColumnName2
See screenshot.
This is a strange behaviour since it’s a common scenario to have columns names in a table can be the same and repeat… For example a column named average with a different meaning depending on the previous column…
Is there a way to prevent this?