View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Larry A[_3_] Larry A[_3_] is offline
external usenet poster
 
Posts: 15
Default VBA code to itemize range names and associations? New Wrinkle

Herbert, Roman -- Thanks much. But now I have a new wrinkle. The
spreadsheet against which I am running uses Hyperion's Essbase Excel add-in
to query Essbase cubes. Essbase apparently stores/embeds information in the
template via the names collection. So the routine suggested runs fine until
it runs into this Essbase stuff. After which it fails to retrieve any
further valid Excel range names. And what does come back is, for me,
gibberish.

Any thoughts at all on how to distinguish between the gibberish and the
valid, native Excel range names? Or some other route into the collection
that might by-pass the gibberish altogether and, in so doing, also guarantee
that I will find the other remaining range names? I know this is a stretch.
but any ideas would be greatly appreciated. Otherwise, I think I am dead in
the water.

Thanks again. Larry.

=========================
"Roman" wrote in message
oups.com...
Hi Larry, hope this helps:

Sub BuildRangeNameList()
Dim i As Integer, s As String, n As Name
For i = 1 To ActiveWorkbook.Names.Count
Set n = ActiveWorkbook.Names(i)
s = n.Name
MsgBox "Name: " & s & vbCrLf & _
"sheet: " & n.RefersToRange.Parent.Name & vbCrLf & _
"range: " & Range(n).Address
Next i
End Sub