We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Range.Text value reads Nothing?

Thread ID:





75978 Aug 19,2008 03:03 AM UTC Aug 19,2008 06:29 AM UTC ASP.NET Web Forms (Classic) 1
Tags: XlsIO
Vidya Jayakumar
Asked On August 19, 2008 03:03 AM UTC

I am trying to read the value of "B2" in the worksheet named "Capture". The Value is coming from no where like the other cells which has list validations. It has just been typed.

When i do
Dim FileDate As String
FileDate = sheet1.Range("B2").Text
FileDate reads the value as Nothing.
Format cell type of B2 is Custom dd-mmm-yy

Sameway B3 is also Custom dd-mmm-yy
if i do
Dim AType As String
AType = sheet1.Range("B3").Text
AType reads RDTE (AEGIS)

Both are of same cell format type,Protected ot not why they behave differently?

I am attaching the file in Question

Revised 14AUG08 - Copy_ce723248.zip

Yavanaarasi G [Syncfusion]
Replied On August 19, 2008 06:29 AM UTC

Hi Vidhya,

I am able to see the issue that you mentioned here. The cell "B2" has the date value. Hence while using Range.text it returns null. But this can be solved by the below two ways:

-You can get the cell value by using the "Value" property.
-You can get the text of the cell by using the "DisplayText" property.

Below is the code snippet:

MessageBox.Show("value of B2:" & sheet.Range("B2").Value)

MessageBox.Show("Text of B2:" & sheet.Range("B2").DisplayText)

Here is the sample for your reference:


Please try this and let me know if this helps.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon