Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EnableEvents not working

Status
Not open for further replies.

bryanbayfield

Technical User
Aug 10, 2001
345
EU
This has me rather perplexed.

I have a form with a number of controls on it - I am having problems with two in particular - a combobox (cmbVar) and a control button (cbuSetProp). When the cbuSetProp is clicked part of the code changes the value of the cmbVar. Since I have code for the cmbVarchange event that I do not want executing, I use Application.EnableEvents = False just before the code that will change cmbVar.

So, what happens when I step through the code - enable events is set to false and - whoah - the cmbVar change event fires.

I can't remember this happening to me before. As luck would have it I have a work around which means I can handle the cmbVar change event firing, but it's a tad worrying. can someone explain to me why this is happening - more as a point of interest than anything because as I say I have a workaround.

And someone get me Bill Gates on the line, please! I have a few choice words for him!
 
Does this happen even when you're not in debug (step-through) mode?
Rob
[flowerface]
 
Yep - it fires when in RUN mode as well.

Stupid thing. I'm off to jump off a doll's house. MUMMMMMM-RAAAAAAAAAAAAAAAAAAAAAAAAA!
 
Very strange. This has never happened to me before. I assume you've exited Excel, rebooted, reinstalled your hard drive, and prayed to the three-headed demon of VBA events?
When I have silly problems, sometimes it helps to remove the module/form in VBE (choosing "Export before removing"), and re-import the module. Some intermittent problems go away for me that way. Rob
[flowerface]
 
I've just stuck a fly in the microwave.

It hasn't helped solve the problem, but I feel better :)

Going to use that workaround I mentioned earlier.

It's quite worrying when stuff like that happens - mind you having used Excel a lot in the past, I should be used to it by now ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top