E
El_Pablo
Hi,
I've done a small program simulating a MonteCarlo sampling and I link
button to generate the chart.
I got this problem and I don't understant why...
Run-time error '1004':
Method 'range' of object '_Worksheet' failed
As you will see the code is very simple...
Code
-------------------
Private Sub btnGenerateChart_Click()
Dim iRepeatMonteCarlo As Integer
Dim iNbSeries As Integer
Dim rgSource As Range
iRepeatMonteCarlo = Range("'SimulationMonteCarlo'!D6").Value
iNbSeries = Range("'SimulationMonteCarlo'!D7").Value
rgSource = Range("'Stat Data'!B7:B96") ' Error 1004 here
'Set rgSource = Range("'Stat Data'!B7:B96") 'Error 1004 here
Call GenerateChart(rgSource, iRepeatMonteCarlo, iNbSeries)
End Sub
-------------------
The range is right because I use the same on the Chart_Activate event.
Thank you
Nic
I've done a small program simulating a MonteCarlo sampling and I link
button to generate the chart.
I got this problem and I don't understant why...
Run-time error '1004':
Method 'range' of object '_Worksheet' failed
As you will see the code is very simple...
Code
-------------------
Private Sub btnGenerateChart_Click()
Dim iRepeatMonteCarlo As Integer
Dim iNbSeries As Integer
Dim rgSource As Range
iRepeatMonteCarlo = Range("'SimulationMonteCarlo'!D6").Value
iNbSeries = Range("'SimulationMonteCarlo'!D7").Value
rgSource = Range("'Stat Data'!B7:B96") ' Error 1004 here
'Set rgSource = Range("'Stat Data'!B7:B96") 'Error 1004 here
Call GenerateChart(rgSource, iRepeatMonteCarlo, iNbSeries)
End Sub
-------------------
The range is right because I use the same on the Chart_Activate event.
Thank you
Nic