If you need to replace the invalid string values in the DataTable
you can do something like the following:
foreach (DataRow row in dt.Rows)
{
for (int i = 0; i < dt.Columns.Count; i++)
{
if(dt.Columns[i].DataType == typeof(string))
row[i] = ReplaceHexadecimalSymbols((string)row[i]);
}
}
Do it before you add it to the workbook