I am using this question to convert Excel data to CSV.
static void ConvertExcelToCsv(string excelFilePath, string csvOutputFile, int worksheetNumber = 1)
{
var cnnStr = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;IMEX=1;HDR=NO\"", excelFilePath);
var cnn = new OleDbConnection(cnnStr);
var dt = new DataTable();
try {
cnn.Open();
}
}
I am getting the following exception once the cnn.open()
line gets executed:
"External table is not in expected format"