I have a workbook with 20 columns and I need to add 4 new columns at the end namely “Old Date” , “New Date” , “Match” and “Code”. The values that would go into these columns are dynamic and are stored into 4 different variables (say a,b,c and d).
I run a for each row on the datatable (say Dt) and then assign the new columns as -
new DataColumn = Dt.Columns.Add(“Old Date”, GetType (String), a)
and similarly for the other columns using variables b,c and d. I am then writing the data table into an excel. While doing that, the output column header comes as “Old Date + (the last date)” with some random long decimal numbers in all rows of that column. For the other columns, it does not even pull the data or throws a Missing Operand ‘REP’ error.
What could be the problem ? Please help.