HI,
you have to manually count the columns as the column.Count does not always provide the correct answer. A simple ways is to do it like
ExcelWorksheet worksheet = excelFile.Worksheets[0];
for (cols = 0; cols < worksheet.Rows[0].AllocatedCells.Count; cols++)
{
if (firstRowHasHeaders)
{
if (worksheet.Rows[0].Cells[cols].Value != null)
ColCount ++;
}
}