View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Need Help with Set Object = Collection(index)

Hi Trip,

I imagine (??) that your .ondata event won't fire until your other code has
finished processing. Though I'm not certain, eg if you have DoEvents in your
code I guess it might.

Howabout, when you finish processing be sure to "Set Market = Nothing", and
before setting Market in your new event

If Not Market is Nothing then
'hmm still working with Market
' Stop ' & debug what's going on
Application,OnTime Now, "proc to go back & set the new market stuff"
Exit Sub
End If

Only a thought!

Regards,
Peter T



"Trip" wrote in message
oups.com...
Hi all,

A little insight would be greatly appreciated,

I have a collection of instances of a class (object = Market,
collection = Markets). When I received an .ondata event I "Set
Market = Markets(IndexNumber)" based upon the market which received
the .ondata event. I then process a series of subs and functions.

My question is this, while processing the series of subs and functions
what happens if I receive another .ondata event for a different market?
Will the "Set Market = Markets(IndexNumber)" happen while I'm in
the middle of processing the other market?
How would you all recommend preserving the state of "Set Market ="
while I'm in the midsts of processing. Or, is this even necessary.
I'm hoping that the current thread would have precedence over the
.ondata event.

Any insight you may have to share would be greatly appreciated.

Thanks,

Trip