Prevent Corollary Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Setting Application.EnableEvents = false can prevent other events from
happening, but how to achieve the same effect when doing with the controls
such as a textbox
on a form when the textbox is assigned a value without causing Change event
to happen

Clara
 
As you know Application.EnableEvents = false only works for excel events.
hosted object events are controlled by the hosted object. What I would do it
add a variable blnFireEvents and within the event code for the third party
object test for this value and run the event code if required. If you mean
stop internal events on the hosted control from firing then you will have to
look at the documentation for the control.

Something like this:

Private blnFireEvents As Boolean

Private Sub TextBox1_Change()

If blnFireEvents Then
'do stuff
Else
'don't do stuff
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top