Error: Unable to cast object of type 'Excel.Core.BinaryFormat.XlsBiffRecord' to type 'Excel.Core.BinaryFormat.XlsBiffDbCell'.

Nov 23, 2012 at 12:44 PM

Hello,
I am having a problem trying to read the spreadsheet contained in the URL "http://www.bcb.gov.br/pom/spb/Down/ftp/prod/Dom20121026.xls"


Code used:

IExcelDataReader excelReader = null;

int row_no = 1;               

int iSh = 0;
string path_excel = "C:\\TMP\\Dom20121026.xls";                               

FileStream excelStream = File.Open(path_excel, FileMode.Open, FileAccess.Read);            excelReader = ExcelReaderFactory.CreateBinaryReader(excelStream);               

DataSet result = excelReader.AsDataSet();


I wonder if anyone has a clue how to solve this?


Thankful.


Leandro