2007: Parent bug in charts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Select a series on a chart

then run

Set Obj = Selection
Do Until TypeName(Obj) = "Workbook"
Debug.print TypeName(Obj)
Set Obj = Obj.Parent
Loop

This never ends on Excel 2007 because strangely, the Parent of the
ChartGroup (which is the parent of Series), is the Series.

This does not happen with previous versions of Excel.

Do you know anyone being the parent of his parents?

MrT
 
Do you know anyone being the parent of his parents?

Actually, it's more like a song I heard years ago, "I'm my own Grampa."

Very strange.

- Jon
 
Select a point and run this code:
_______

Sub ChartParent()
Dim obj As Object
Dim i As Long

i = 0

Set obj = Selection
Do Until TypeName(obj) = "Workbook"
Debug.Print TypeName(obj)
Set obj = obj.Parent
If i > 25 Then
Debug.Print "25 items"
Exit Do
End If
i = i + 1
Loop

End Sub
_______

Excel 2000:

Point
Series
ChartGroup
Chart
ChartObject
Worksheet
_______

Excel 2007:

Point
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
Series
ChartGroup
25 items
_______

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top