View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Click event on listbox

Application.enableevents = false

to turn events off. Be usre to turn them back on with

Application.enableevents = true

As these are application level evnet sit is a good idea to have an error
handler which resets the events in the event of a problem. Also when you are
debugging be carefule about stopping execution half way through. Your events
will be off and the code will seem to be not reacting as it should...

HTH

"IanC" wrote:

I have a dialog that controls an interactive chart. This has a number of
listboxes, all of which have click events attached. When the user selects an
option in a box (say ListIndex = 4) that produces a combination of choices
that is not allowed, I need to revert the listbox to a permissible option
(say ListIndex =0).

Unfortunately, this just seems to create a new click event that, for some
reason, reverts the ListIndex back to the unpermissible option (i.e. 4) and
repeats the error.

Is there any way to stop these recurrent click events. I have tried using a
static boolean expression and disabling events, but it does not seem to to
stop the macro 'circling' at least twice.

Ian