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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Read XLSIO Named Range cell value

Thread ID:

Created:

Updated:

Platform:

Replies:

107065 Feb 11,2013 11:46 AM UTC Feb 13,2013 11:53 AM UTC WPF 1
loading
Tags: XlsIO
Richard Tatlow
Asked On February 11, 2013 11:46 AM UTC

I have a spreadsheet with a set of named ranges. Each range defines a single cell. I wish to read each of the cell values with a specified type: double, integer, text, date.
I can retrieve the collection of names through workbook.Names and workbook.Names.Count.
for (int i = 0; i < workbook.Names.Count; i++)
{
    s = workbook.Names[i].Name.ToString();
}

How do I use the collection 'workbook.Names[i]' to read the cell value in each case ?
Do I have to parse the range name 'xxxxxxxxx'!$A$1 in each case and read the worksheet cell value or is there a property/method in the Names[] collection ?

Manikandan M [Syncfusion]
Replied On February 13, 2013 11:53 AM UTC

Hi Richard,

Thanks for using Syncfusion products.

For reading the cell value, we could use the 'Value' property of named range in worksheet range property  .We have created the simplified sample to read the cell value for above said scenario and have attached the same in the below link.

Sample link:107065.zip

Code snippet:
            string name;
            object cellValue;
            for (int i = 0; i < workbook.Names.Count; i++)
            {
                name = workbook.Names[i].Name.ToString();
                cellValue = workbook.Worksheets[0].Range[workbook.Names[i].Value].Value;
            }

Thank you very much for your patience. Please let us know if you need any clarifications.

Thanks,
Manikandan M.

CONFIRMATION

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.

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

;