I am handling/reading Excel workbook using VB.Net Code.
Everything goes OK if worksheet has less than 20000 rows, but if it is more than 20000 then it throws following exception.
Conversion from type 'Object(,)' to type 'String' is not valid.
My problem is that why it works some time and does not other time?
What could be the potential problem??
Code looks like this:
uArea.Digits = CurrentRow.Columns(AREA_DIGIT).value
uArea.ValidFrom = CurrentRow.Columns(VALID_FROM).value
EDIT: Could this be the reason that i need to expose or dispose excel object ? in that case , is it possible to dispose Excel object? OR can i use GC.Collect? Please Help.
Edited 14-Jan-13 4:21am
This error may actually have nothing to do with the size of the excel. One of the rows after row 20000 may have some data that may be of a different type. It will be worth doing a quick data validation of the Excel file.
Edited 13-Jan-13 23:23pm
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)