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.
InvalidCastException Occured
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.