ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Missing Cell in a column when it is on row 16 (https://www.excelbanter.com/excel-programming/334285-missing-cell-column-when-row-16-a.html)

Matt

Missing Cell in a column when it is on row 16
 
Hi,
I read an excel worksheet in Delphi.
In a particular column I have a column name, then 15 empty rows and then a
number on row 16.
This column has the type string.

First question:
When in Delphi I check the value on row 16 it says NULL, and not the value
given in excel. Why?

Second question:
If I move my value on row 16 to a row less than row 10 then the format of
the column is changed automatically to FLOAT and then the value is the same
as given in excel.



Gary L Brown

Missing Cell in a column when it is on row 16
 
Matt,
You might want to try finding a 'Delphi' site to get this question
answered. That said, I DO<< know that Excel uses a registry value to look
at the 1st xxx rows to determine data type. I'll bet you that Delphi does
the same.

I'll tell you about Excel and MAYBE this will give you some ideas to check
for Delphi.

Excel has 2 registries it uses to determine each column's data
type,'ImportMixedTypes' and 'TypeGuessRows' in the segment
'Hkey_Local_Machine\Software\Microsoft\Jet\4.0\Eng ines\Excel\'.

The ImportMixedTypes registry key has only two valid values...
'Text' and 'Majority Type'

'Text' means that all data will be imported as text regardless of what it
actually is. Only the 1st 255 characters will be imported.

'Majority Type' means up to xxx rows in each column are checked and the data
types are counted. The majority data type decides the overall data type for
the entire column. Rows with other data types will be returned with a null
value. The 'TypeGuessRows' registry tells how many rows to look at.

'TypeGuessRows' contains the 'xxx' number of rows to scan. A value of zero
means all rows will be scanned.

HTH,
--
Gary Brown

If this post was helpful, please click the ''''Yes'''' button next to
''''Was this Post Helpfull to you?".


"Matt" wrote:

Hi,
I read an excel worksheet in Delphi.
In a particular column I have a column name, then 15 empty rows and then a
number on row 16.
This column has the type string.

First question:
When in Delphi I check the value on row 16 it says NULL, and not the value
given in excel. Why?

Second question:
If I move my value on row 16 to a row less than row 10 then the format of
the column is changed automatically to FLOAT and then the value is the same
as given in excel.




All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com