I'm trying to read excel data into datatable object.But, some columns in excel is has corrupted data specifically of type DATE .
I'm using VB code to read the data with
OLEDB Connection
dtData = objExcelReader.ReadWorksheet(strFilePath.ToString, "select * from sheet1$", True)
With this code I get 'Not a legal OleAut date' error.
With ExcelReader,
objExcelReader = New ExcelIO.ExcelReader
objExcelReader.UseHeaders = True
objExcelReader.AllowSpacesInColumnName = blnAllowSpacesInColumnName
objExcelReader.ReadFormatting = True
objExcelReader.TrimStrings = True
objExcelReader.ClearColumnDatatypes()
objExcelReader.DefaultStartRow = intStartRow
dtData = objExcelReader.Read(strFilePath.ToString, thisApplication, strInputSheetName)
I get exception - 'Out of present range. (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW))'
Using range in query, I'm able to fetch records. I need to include multiple range in that case.
dtData = objExcelReader.ReadWorksheet(strFilePath.ToString, "select * from sheet1$O:AK", True)
Can someone help me to include multiple range here like A:K & O:AK
Or to fix any of above mentioned issues and ignore those exceptional column.
User contributions licensed under CC BY-SA 3.0