Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Value of type 'General' cell different from 'Number' or 'Text'?

Hi,
I have a problem to get single numeric values from an Excel worksheet (that
I need to process as I receive it).
The Value property is null for a type General field.
The Value property contains the right value in case of number or text type.
I use the Microsoft Excel 9.0 Library (and C#) because I need to process
Excel 2000/2003 files.
It must be simple, but I can't find the solution.
Who can help me?

Thanks,
Gijs


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Value of type 'General' cell different from 'Number' or 'Text'?

Read the value as text. you can then use then can test the string in C# using
IsNumber().

"Gijs" wrote:

Hi,
I have a problem to get single numeric values from an Excel worksheet (that
I need to process as I receive it).
The Value property is null for a type General field.
The Value property contains the right value in case of number or text type.
I use the Microsoft Excel 9.0 Library (and C#) because I need to process
Excel 2000/2003 files.
It must be simple, but I can't find the solution.
Who can help me?

Thanks,
Gijs


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Value of type 'General' cell different from 'Number' or 'Text'?

On 6 aug, 15:39, Joel wrote:
Read the value as text. you can then use then can test the string in C# using
IsNumber().



"Gijs" wrote:
Hi,
I have a problem to get single numeric values from an Excel worksheet *(that
I need to process as I receive it).
The Value property is null for a type General field.
The Value property contains the right value in case of number or text type.
I use the Microsoft Excel 9.0 Library (and C#) because I need to process
Excel 2000/2003 files.
It must be simple, but I can't find the solution.
Who can help me?


Thanks,
Gijs- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


The 'Value' is null and the 'Text' is emtry "".
Where is the cell contents stored in case of NumberFormat = General?
Thanks,
Gijs
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Value of type 'General' cell different from 'Number' or 'Text'

The cell contents text is always stored in the same location. Number and
text may end up in a different class an be right or left justified. I think
it would be better just to force text to be read. Then do you own type
conversion is C#.

In excel yo sometimes end up with spaces in front or at the end of a number
which would convert the number to text. I often in excel vba perform a trim
to get rid of extra spaces. A worksheet is entered by hand and not by a
program. People often type extra spaces into excel worksheets. Programs
then have a lot of problems handling the extra space conditions.

"Gijs" wrote:

On 6 aug, 15:39, Joel wrote:
Read the value as text. you can then use then can test the string in C# using
IsNumber().



"Gijs" wrote:
Hi,
I have a problem to get single numeric values from an Excel worksheet (that
I need to process as I receive it).
The Value property is null for a type General field.
The Value property contains the right value in case of number or text type.
I use the Microsoft Excel 9.0 Library (and C#) because I need to process
Excel 2000/2003 files.
It must be simple, but I can't find the solution.
Who can help me?


Thanks,
Gijs- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


The 'Value' is null and the 'Text' is emtry "".
Where is the cell contents stored in case of NumberFormat = General?
Thanks,
Gijs

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change cell format from text to general on the fly JSnow Excel Discussion (Misc queries) 9 August 13th 08 04:25 PM
Convert text date to general number Andrew Excel Discussion (Misc queries) 6 July 19th 07 09:03 AM
Converting data in General Format cell to a number PE Excel Discussion (Misc queries) 3 October 26th 06 11:58 AM
Cell Format changed from General to number BJ Excel Programming 1 September 20th 06 04:31 PM
change pivot field of button type figure to general text x taol Excel Programming 0 May 23rd 06 02:14 AM


All times are GMT +1. The time now is 05:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"