ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   2007: Parent bug in charts (https://www.excelbanter.com/excel-programming/378159-2007-parent-bug-charts.html)

mrt

2007: Parent bug in charts
 
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






Jon Peltier

Parent bug in charts
 
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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"MrT" wrote in message
...
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








Jon Peltier

Parent bug in charts
 
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/
_______



"Jon Peltier" wrote in message
...
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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"MrT" wrote in message
...
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











All times are GMT +1. The time now is 11:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com