Unfortunately the GetColumnNames()
method only works when the header row is on row 1.
However, it should be possible to get the column names by using the WorksheetRangeNoHeader()
method.
It would look something like this
var excel = new ExcelQueryFactory("excelFileName");
// Only select the header row
var headerRow = from c in excel.WorksheetRangeNoHeader("A4", "Z4")
select c;
var columnNames = new List<string>();
foreach (var headerCell in headerRow)
columnNames.Add(headerCell.ToString());