Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read or retrieve value from spreadsheet using existing rangenames #59

Closed
ravianand1988 opened this issue Oct 6, 2016 · 6 comments
Closed

Comments

@ravianand1988
Copy link

i have an existing excel file and it has already defined cell name or cell range names.

I am able to get all cell range names using Openxml sdk. my sample code is given below:

 var path = @"D:\test.xlsx";
        using (var document = SpreadsheetDocument.Open(path, true))
        {
            var workbookPart = document.WorkbookPart;
              var wb = workbookPart.Workbook;
            var definedNames = wb.DefinedNames;
            if (definedNames != null)
            {
                System.Console.WriteLine("Name\tText\tName.Value");
                foreach (DefinedName dn in definedNames)
                {
                    System.Console.WriteLine(dn.Name + "\t" + dn.Text + "\t" + dn.Name.Value);

                }
            }

        }

Is there any way to retrieve or read cell value from defined name using this OpenXml or any other SDK in c#?
Any Help would be highly appreciable.
Thanks

@igitur
Copy link
Member

igitur commented Oct 6, 2016

Have a look at Named Ranges and Accessing Named Ranges

(We're busy migrating the documentation over to here on GitHub).

@ravianand1988
Copy link
Author

thanks a lot, it worked.

@ckernsiii
Copy link

Can we get a new reference to this as everything basically points to OLD data on a non-existing website. Everything points to github and it is very loosely pointing anywhere

@igitur
Copy link
Member

igitur commented Apr 5, 2018

@ckernsiii The new wiki is at https://github.com/ClosedXML/ClosedXML/wiki

@ckernsiii
Copy link

Thanks for the URL. I've already been there and still find my issue inconclusive with the given data. For instance, there is no equivalent exchange between OpenXML and ClosedXML so integrating Closed into Open is near impossible unless I fully learn everything about Closed AND Open before jumping in.

@igitur
Copy link
Member

igitur commented Apr 5, 2018

I have no idea what you're trying to do. Please open a new issue and complete the full issue template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants