p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Other Office > Visual Studio Tools for Office
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Visual Studio Tools for Office Be sure to specify which version you are working with.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio Tools for Office section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 6th, 2009, 10:08 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Value = null for cell with numeric format General.

Hi,

I have a problem to get single numeric values from an Excel worksheet (that I need to process as I receive it).
I use the Microsoft Excel 9.0 Library because I need to process EXcel 2000/2003 files.
This is the range:

Excel.Range CellRange = (Excel.Range) WS.Cells[RowNum, ColNum];

I use this statement to check format and cell.

MessageBox.Show(CellRange.NumberFormat.ToString() + "\n" + RowNum.ToString() + "\n" + ColNum.ToString());

Only in case of format 0.0 I can get a value (e.g. 234.9) like this:

Result = Convert.ToDouble(CellRange.Value);
MessageBox.Show(Result.ToString());

But the format can also be General with values e.g. 234.9 (with point), 234,9 (with comma) or 2349 (without separator).
The value property is null for a cell with numeric format General.

It must be simple, but I can't find the solution.
Who can help me?

Thanks,
Gijs
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select date from cell with m/d/yyyy h:mm format mona_upm84 Excel VBA 2 August 10th, 2008 06:58 PM
Cell Accounting Format jcarey00 Excel VBA 1 September 28th, 2007 05:47 AM
numeric format for a textbox Rudner Beginning VB 6 1 November 9th, 2004 02:29 PM
Numeric or currency field format acdsky ASP Forms 2 July 14th, 2004 09:22 AM
format Table and Cell in XSL? bebe XML 2 November 13th, 2003 01:49 PM



All times are GMT -4. The time now is 12:52 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc