Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default error 424 object required

Iam working on Agent Based Modeling system using Microsoft Excel.I'm
getting an error saying 424 object required at this part of the code

[Frustration].Offset(1,1)=0

this is the full code
Sub Initialize()

' Declare the local variables.
Dim shopper As Range

' Set the ranom seed.
Rnd (-1)
Random_Seed = 10

Randomize ([Random_Seed])
' Reset the graph.
[Frustration].Offset(1, 1) = 0
[Frustration].Offset(2, 1) = 0
[GraphLables].Clear
[GraphValues].Clear

' Initilaize all of the shoppers.
For Each shopper In [Shoppers]

' Complete the basic shopper initilization.
Call InitializeShopper(shopper)

' Reset the items found counter.
shopper.Offset(0, 13) = 0

' Resett the trip counter.
shopper.Offset(0, 14) = 1

' strat with a moderate frustration level.
shopper.Offset(0, 12) = [Initial_Frustration]

Next shopper

End Sub

Please let me know the solution as soon as possible
Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default error 424 object required

The only reason you would use square brackets is if the items in the square
brackets are defined names in Excel (Insert=Name=Define)

if Frustration is a rng reference

set Frustration = Range("A1")

then

Frustration.Offset(1,1) = 0

would work.

Demo'd from the immediate window:

Random_Seed = 10
? [Random_Seed]
Error 2029
? Random_Seed
10


--
Regards,
Tom Ogilvy


" wrote:

Iam working on Agent Based Modeling system using Microsoft Excel.I'm
getting an error saying 424 object required at this part of the code

[Frustration].Offset(1,1)=0

this is the full code
Sub Initialize()

' Declare the local variables.
Dim shopper As Range

' Set the ranom seed.
Rnd (-1)
Random_Seed = 10

Randomize ([Random_Seed])
' Reset the graph.
[Frustration].Offset(1, 1) = 0
[Frustration].Offset(2, 1) = 0
[GraphLables].Clear
[GraphValues].Clear

' Initilaize all of the shoppers.
For Each shopper In [Shoppers]

' Complete the basic shopper initilization.
Call InitializeShopper(shopper)

' Reset the items found counter.
shopper.Offset(0, 13) = 0

' Resett the trip counter.
shopper.Offset(0, 14) = 1

' strat with a moderate frustration level.
shopper.Offset(0, 12) = [Initial_Frustration]

Next shopper

End Sub

Please let me know the solution as soon as possible
Thanks in advance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default error 424 object required

On Aug 28, 10:32 am, Tom Ogilvy
wrote:
The only reason you would use square brackets is if the items in the square
brackets are defined names in Excel (Insert=Name=Define)

if Frustration is a rng reference

set Frustration = Range("A1")

then

Frustration.Offset(1,1) = 0

would work.

Demo'd from the immediate window:

Random_Seed = 10
? [Random_Seed]
Error 2029
? Random_Seed
10

--
Regards,
Tom Ogilvy

" wrote:
Iam working on Agent Based Modeling system using Microsoft Excel.I'm
getting an error saying 424 object required at this part of the code


[Frustration].Offset(1,1)=0


this is the full code
Sub Initialize()


' Declare the local variables.
Dim shopper As Range


' Set the ranom seed.
Rnd (-1)
Random_Seed = 10


Randomize ([Random_Seed])
' Reset the graph.
[Frustration].Offset(1, 1) = 0
[Frustration].Offset(2, 1) = 0
[GraphLables].Clear
[GraphValues].Clear


' Initilaize all of the shoppers.
For Each shopper In [Shoppers]


' Complete the basic shopper initilization.
Call InitializeShopper(shopper)


' Reset the items found counter.
shopper.Offset(0, 13) = 0


' Resett the trip counter.
shopper.Offset(0, 14) = 1


' strat with a moderate frustration level.
shopper.Offset(0, 12) = [Initial_Frustration]


Next shopper


End Sub


Please let me know the solution as soon as possible
Thanks in advance


Thanks a lot for the suggestion

Random_Seed i had kept it as 10 as before it gave 2029 error.Can i
keep it like that

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default error 424 object required

If you don't use brackets to refer to it, then it won't give the 2029 error.

--
Regards,
Tom Ogilvy


" wrote:

On Aug 28, 10:32 am, Tom Ogilvy
wrote:
The only reason you would use square brackets is if the items in the square
brackets are defined names in Excel (Insert=Name=Define)

if Frustration is a rng reference

set Frustration = Range("A1")

then

Frustration.Offset(1,1) = 0

would work.

Demo'd from the immediate window:

Random_Seed = 10
? [Random_Seed]
Error 2029
? Random_Seed
10

--
Regards,
Tom Ogilvy

" wrote:
Iam working on Agent Based Modeling system using Microsoft Excel.I'm
getting an error saying 424 object required at this part of the code


[Frustration].Offset(1,1)=0


this is the full code
Sub Initialize()


' Declare the local variables.
Dim shopper As Range


' Set the ranom seed.
Rnd (-1)
Random_Seed = 10


Randomize ([Random_Seed])
' Reset the graph.
[Frustration].Offset(1, 1) = 0
[Frustration].Offset(2, 1) = 0
[GraphLables].Clear
[GraphValues].Clear


' Initilaize all of the shoppers.
For Each shopper In [Shoppers]


' Complete the basic shopper initilization.
Call InitializeShopper(shopper)


' Reset the items found counter.
shopper.Offset(0, 13) = 0


' Resett the trip counter.
shopper.Offset(0, 14) = 1


' strat with a moderate frustration level.
shopper.Offset(0, 12) = [Initial_Frustration]


Next shopper


End Sub


Please let me know the solution as soon as possible
Thanks in advance


Thanks a lot for the suggestion

Random_Seed i had kept it as 10 as before it gave 2029 error.Can i
keep it like that


Reply
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
Object required error anamarie30 Excel Programming 3 April 25th 07 08:28 PM
Object Required Error MarkHear1 Excel Programming 7 April 25th 07 03:51 PM
Object required error 424 why getting? Chet Excel Programming 2 April 6th 07 07:26 PM
Error: 424 Object required DavidM[_3_] Excel Programming 1 January 13th 05 03:23 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 10:40 AM.

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"