Als ik in Excel de volgende macro probeer uit te voeren ( openSheets ) krijg ik bij de laatste instructie ( setSeries(plotChart) ) de foutmelding dat het Object de methode of eigenschap niet ondersteund.
Heb geen idee wat ik fout doe, iemand anders misschien wel?
Visual Basic:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| Sub openSheets() Dim plotChart As Chart Set plotChart = openPlotChart("TestChart") plotChart.SeriesCollection.Add (Worksheets("Sheet1").Range("B1:B9")) setSeries (plotChart) End Sub Function openPlotChart(naam As String) As Chart Charts.Add 'Charts(1).name = naam Set openPlotChart = Charts(1) End Function Sub setSeries(pChart As Chart, Optional index As Integer = 1) pChart.SeriesCollection(index).XValues = Array(0.1, 4, 3, 4, 5, 6, 5) pChart.SeriesCollection(index).Type = xlXYScatter End Sub |
Heb geen idee wat ik fout doe, iemand anders misschien wel?