LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default unable to get original cell value from a "number stored as text"

I am running against a little issue. I have an excel spreadsheet, that I need to be able to read in C#. No problem there. The issue is that the system creating the spreadsheet uses a particular trick to format a number, so that the leading "0" is intact and displays. For example, the system writes a '02.7 so that excel displays 02.7.

When I travers the Range and read the value of the cell in c# or even the VBA Macro editor built into Excel, I get the numerical 02.7. I do not get the text (with leading apostrophe) '02.7. I need the full text. Does anyone know how excel stores the original data in the cell and how to get it back. I noticed that there is a little green triangle in the top, left corner of the cell. This has an error called "Number Stored as Text" I have tried looking at the range's error object with no luck.

Here is how I am getting the value in c
Excel.Range rngCurrent =
exlRange.get_Range("B3", System.Reflection.Missing.Value);

rngCurrent.Value2.ToString()

Thanks!!
 
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
"Find" a wildcard as a place marker and "replace" with original va Eric Excel Discussion (Misc queries) 1 January 27th 09 06:00 PM
Pasted values that paste as "number stored as text" smartgal Excel Discussion (Misc queries) 3 July 2nd 08 01:27 AM
Text stored in a cell is displayed as a string of "#####..." David Walter Excel Discussion (Misc queries) 5 November 12th 07 07:53 PM
EXCEL - unable to get "TEXT" to wrap, even though cell is formatte onerudecat Excel Worksheet Functions 3 July 31st 07 08:10 PM
How do I ignore the "Number stored as text" error message permane. reston33 Excel Discussion (Misc queries) 2 March 28th 07 02:59 AM


All times are GMT +1. The time now is 12:19 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"