Looping thre named ranges

  • Thread starter Jim in Fort Worth Texas
  • Start date
J

Jim in Fort Worth Texas

Using vb.net how does one loop thur named ranges in an Excel Wordbook?

Thank you
 
J

joel

this code works in VBA, not sure about VB.Net.


For Each nm In ThisWorkbook.Names
MsgBox (nm.Name & " refersto : " & nm.RefersTo)
Next nm
 
J

Jacob Skaria

As Joel mentioned the names is a collection which is part of the XL object
model.

xlApp.ActiveWorkbook.Names.Count

PS; An object type is available for Excel names
Microsoft.Office.Interop.Excel.Name
 
Top