LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button programming Run-time error '1004' with range


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 3 April 14th 09 10:35 PM
Run-Time error '1004' : Select method of Range class failed [email protected] Excel Discussion (Misc queries) 3 March 9th 07 01:36 PM
Run-time error '1004' on Range.Activate Don Rouse Excel Programming 9 August 25th 05 04:05 PM
Run-time error '1004' PasteSpecial Method of Range Class Failed Kevin G[_2_] Excel Programming 1 February 3rd 04 05:01 AM
Run-time 1004 error on range select Morgan[_3_] Excel Programming 3 November 11th 03 11:44 PM


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"