?
Solved

Excel vsto iterate named ranges

Posted on 2009-05-13
1
Medium Priority
?
1,042 Views
Last Modified: 2013-11-10
I need to get a list of all the named ranges in excel

I am upgrading code from an the original version of vsto

  For Each myNames In oSheet.Names     'Get all range definitions
                   Mypage.Add(myNames.Name)
    Next

In VSTO 2008 this doesnt work
0
Comment
Question by:JonMny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
akari1910 earned 2000 total points
ID: 24382227
Please try this code
Dim App As Excel.Application = Globals.ThisAddIn.Application
Dim ThisWB As Excel._Workbook = App.ActiveWorkbook
        MsgBox(ThisWB.Names.Count)
        For Each n As Excel.Name In ThisWB.Names
            MsgBox(n.Name)
        Next

Open in new window

0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question