How do I do validation comparing text file with excel file?

You can make this change:

Where(Function(name) name <> “Result” AndAlso name <> dt_InputData.Columns(dt_InputData.Columns.Count - 2).ColumnName).ToList()