Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 -- El_Pabl ----------------------------------------------------------------------- El_Pablo's Profile: http://www.excelforum.com/member.php...fo&userid=3312 View this thread: http://www.excelforum.com/showthread.php?threadid=52965 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error '1004': AutoFill method of Range class failed | Excel Discussion (Misc queries) | |||
Run-Time error '1004' : Select method of Range class failed | Excel Discussion (Misc queries) | |||
Run-time error '1004' on Range.Activate | Excel Programming | |||
Run-time error '1004' PasteSpecial Method of Range Class Failed | Excel Programming | |||
Run-time 1004 error on range select | Excel Programming |