Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
rci rci is offline
external usenet poster
 
Posts: 40
Default Suppressing events

Hi all...


I am changing the value of a checkbox in code... and I need to suppress the
click event when doing so. How might I do this?

In other words, changing the value of a checkbox triggers the .click event,
and I need to prevent this...

Thanks!

M
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Suppressing events

application.enableevents = false

BIG NOTE be very sure to reenable events with application.enableevents =
true or else events will not function AT ALL.

"rci" wrote:

Hi all...


I am changing the value of a checkbox in code... and I need to suppress the
click event when doing so. How might I do this?

In other words, changing the value of a checkbox triggers the .click event,
and I need to prevent this...

Thanks!

M

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Suppressing events

Application.EnableEvents only works on Excel events, not on the events
associated with msforms control - a completely different library.

--
Regards,
Tom Ogilvy

"ben" wrote in message
...
application.enableevents = false

BIG NOTE be very sure to reenable events with application.enableevents =
true or else events will not function AT ALL.

"rci" wrote:

Hi all...


I am changing the value of a checkbox in code... and I need to suppress

the
click event when doing so. How might I do this?

In other words, changing the value of a checkbox triggers the .click

event,
and I need to prevent this...

Thanks!

M



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Suppressing events

One technique is to declare a public variable at the top of a general module

Public bBlockEvents as Boolean

then in the click event of the control

Private Sub Checkbox1_Click()
if bBlockEvents then exit sub
' you current code
End Sub

Then in the code that would trigger the event

bBlockEvents = True
' code that would trigger the event
bBlockEvents = False

so anytime you want to block events, set the flag (bBlockEvents) to true

Every event procedure (that you want to be able to block) must check the
value of the flag as the first thing and exit if it is true.


--
Regards,
Tom Ogilvy


"rci" wrote in message
...
Hi all...


I am changing the value of a checkbox in code... and I need to suppress

the
click event when doing so. How might I do this?

In other words, changing the value of a checkbox triggers the .click

event,
and I need to prevent this...

Thanks!

M



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
Suppressing startup routine Mark Excel Discussion (Misc queries) 3 March 6th 06 01:19 PM
Hi all!! Suppressing the "Do you want to save changes" Bony Pony Excel Worksheet Functions 2 February 2nd 05 11:39 AM
Suppressing output Norman Jones Excel Programming 0 September 8th 04 04:35 PM
Suppressing output Iain King Excel Programming 0 September 8th 04 04:34 PM
Suppressing messages Ron de Bruin Excel Programming 0 September 4th 03 03:51 PM


All times are GMT +1. The time now is 12:37 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"