Option
Explicit
Dim
oWsh
As
Excel.Worksheet
Dim
oShp
As
Shape
Dim
oChart
As
Excel.Chart
Dim
oObj
As
Excel.ChartObject
Sub
WasIstWo()
Set
oWsh = Sheets(
"Tabelle2"
)
For
Each
oShp
In
oWsh.Shapes
With
oShp
Set
oChart = .Chart
Debug.Print oShp.ID, _
oShp.Name, _
oChart.Name, _
oChart.ChartTitle.Text
End
With
Next
oShp
Set
oWsh =
Nothing
Set
oShp =
Nothing
Set
oChart =
Nothing
End
Sub
Sub
ChartEigenschaften()
Set
oWsh = Sheets(
"Tabelle2"
)
Set
oObj = oWsh.ChartObjects(
"Diagramm 2"
)
With
oObj
.Chart.ChartTitle.Text =
"Neuer Titel"
.Chart.SetSourceData Source:=Range(
"A1:B10"
)
End
With
Set
oWsh =
Nothing
Set
oObj =
Nothing
End
Sub
Sub
Datenbereich()
Set
oWsh = Sheets(
"Tabelle2"
)
Set
oObj = oWsh.ChartObjects(
"Diagramm 2"
)
Set
oChart = oObj.Chart
Dim
intseries
For
intseries = 1
To
oChart.SeriesCollection.Count
Debug.Print oChart.SeriesCollection(intseries).Formula
Next
intseries
Set
oWsh =
Nothing
Set
oChart =
Nothing
Set
oObj =
Nothing
End
Sub