E
El_Pablo
Hi,
I've been trying to create a very basic chart with some simple values
in it. It works fine for a small quantity of values (let say 100), but
as soon as the number of values gets bigger, I get a 1004 error "Unable
to set the values property of the series class".
I've been trying to work this out for the last 2 hours and usually I'm
pretty good to programming everything else than VBA.
Here's my code:
Code:
--------------------
Private Sub Chart_Activate()
Dim iArray() As Integer
Dim iNbElements As Integer
Dim i As Integer
Dim sSeries As Series
iNbElements = 180
ReDim iArray(1 To iNbElements) As Integer
For i = 1 To iNbElements
iArray(i) = i
Next
For Each sSeries In ActiveChart.SeriesCollection
sSeries.Delete
Next
Set sSeries = ActiveChart.SeriesCollection.NewSeries
sSeries.ChartType = xlXYScatter
sSeries.Values = iArray ' *The error is here!! Making me crazy!!*
Set sSeries = Nothing
End Sub
--------------------
Please someone help me!
Nick
I've been trying to create a very basic chart with some simple values
in it. It works fine for a small quantity of values (let say 100), but
as soon as the number of values gets bigger, I get a 1004 error "Unable
to set the values property of the series class".
I've been trying to work this out for the last 2 hours and usually I'm
pretty good to programming everything else than VBA.
Here's my code:
Code:
--------------------
Private Sub Chart_Activate()
Dim iArray() As Integer
Dim iNbElements As Integer
Dim i As Integer
Dim sSeries As Series
iNbElements = 180
ReDim iArray(1 To iNbElements) As Integer
For i = 1 To iNbElements
iArray(i) = i
Next
For Each sSeries In ActiveChart.SeriesCollection
sSeries.Delete
Next
Set sSeries = ActiveChart.SeriesCollection.NewSeries
sSeries.ChartType = xlXYScatter
sSeries.Values = iArray ' *The error is here!! Making me crazy!!*
Set sSeries = Nothing
End Sub
--------------------
Please someone help me!
Nick