How do I compare the column headings of one excel sheet to another?
- Read the two xl sheet in two different datatable.
2.Keep a do while loop with column index.
3.Inside Loop check the tbl1.Columns(intCol).ColumnName = tbl2.Columns(intCol).ColumnName
4.add string array the difference colum Name.
My issue now is that the spreadsheet may have duplicate column headers which is not allowed when reading in a data table with headers.
Here is the code that I finally used for comparing the headers. In my case the first spreadsheet is the template and only has the headers.
The code has you select your own files.