read nulls in excel
I am successfully using VB ADO to read cells in Excel. However, for one particular set of columns, the value is turning out to be null (runtime error 94) even though there is a value in that particular excel cell (or column if you prefer). There is no special formatting on that cell, except that it has a left border. Retyping the value does not solve the problem. I copied and pasted the column to another sheet, and that did not help either. The sheet is not linked to any external file or source. Does anyone have any idea why an excel column with a value returns a null when VB attempts to read it?
# 1 Re: read nulls in excel
This is hard to comment on without some example of how you are using ADO to read the cell as there are multiple ways to accomplish this task. If you could post the line(s) of code that you are using to read the cell it would be of benefit when formulating a response to your question.
-K
Kdev at 2007-11-10 0:43:57 >

# 2 Re: read nulls in excel
Well, actually, the problem was that the first six rows were of character datatype while all the remaining were numbers. The solution is to select just the number datatype range. Note that there is a world of a difference between having first 5 rows and first 6 rows of a different datatype. I think 6 is the default cut-off limit or something because I did not face this problem on a worksheet which had the first 5 rows as a character datatype and all the rest as numbers.