Ik wil volgende grafiek maken, maar loop vast op de naam van de grafiek die in de macro opgenomen is. Ik slaag er niet in om deze naam te traceren.

Hierbij de code
Code:
Sub InWerkboekChart()
'
' InWerkboekChart Macro
'
' ActiveChart.Parent.Name = "Grafiek 1" >>>> dit lost het niet op
[/B]
ActiveSheet.Shapes.AddChart2(227, xlLine).Select
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(1).Name = "=Data!$A$4"
ActiveChart.FullSeriesCollection(1).Values = "=Data!$B$4:$W$4"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(2).Name = "=Data!$A$3"
ActiveChart.FullSeriesCollection(2).Values = "=Data!$B$3:$W$3"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(3).Name = "=Data!$A$5"
ActiveChart.FullSeriesCollection(3).Values = "=Data!$B$5:$W$5"
ActiveChart.FullSeriesCollection(3).XValues = "=Data!$B$2:$W$2"
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).CategoryType = xlCategoryScale
ActiveChart.FullSeriesCollection(1).Select
ActiveChart.SetElement (msoElementDataLabelTop)
With Selection
.MarkerStyle = 1
.MarkerSize = 5
End With
Selection.MarkerStyle = 2
Selection.MarkerSize = 7
Range("X10").Select
ActiveSheet.ChartObjects("Grafiek 1").Activate >>>> hierbij de fout
ActiveSheet.Shapes("Grafiek 1").Height = 425.1968503937
ActiveSheet.Shapes("Grafiek 1").Width = 1133.8582677165
ActiveSheet.ChartObjects("Grafiek 1").Activate
ActiveSheet.Shapes("Grafiek 1").IncrementLeft -522
ActiveSheet.Shapes("Grafiek 1").IncrementTop -177.75
ActiveSheet.ChartObjects("Grafiek 1").Activate
ActiveChart.Axes(xlCategory).Select
ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
ActiveChart.SetElement (msoElementChartTitleAboveChart)
ActiveChart.SetElement (msoElementDataTableWithLegendKeys)
End Sub