View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
T_o_n_y T_o_n_y is offline
external usenet poster
 
Posts: 43
Default Stop the _Change event? Is there EnableEvents for Forms?

I would like to be able to temporarily disable one of the _Change events in
my form because I don't want it to fire during, for example, the initialize
sub. I've tried several things including using the .enabled=false, and
..locked=false, and even Application.EnableEvents = False, ...but the _Change
event still fired. Here is the specific sub I want to temporarily disable.
It's for a textbox called CurrentPBox that calls a very involved Draw routine.

Private Sub CurrentPBox_click()
If IsNumeric(CurrentPBox) And CurrentPBox <= CurrentPSpin.Max _
And CurrentPBox = CurrentPSpin.Min Then
pCurrentP = CurrentPBox 'if its a valid value, store the value & spin
CurrentPSpin = CurrentPBox
DrawPetal pCurrentP, p, m, s, pCor
pBox = pCurrentP
Else
CurrentPBox = pCurrentP 'if its invalid, replace it with what had been there
End If
End Sub

Thanks!
-Tony