Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Click event on listbox

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Click event on listbox

Many thanks.

The click event still repeats itself, but only after it has reached End Sub
for the first time. And its ListIndex still reverts at that stage to the
original (unpermissible) value. Taking out the change to ListIndex solves
the problem (so I am reasonably certain that is the problem), but still
leaves the original value showing in the ListBox.

"Jim Thomlinson" wrote:

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

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
capture listbox click Joanne New Users to Excel 13 July 7th 07 01:00 PM
ListBox Click Event BHatMJ Excel Discussion (Misc queries) 6 June 21st 07 09:34 PM
click event on listbox CStephenson Excel Programming 1 March 22nd 05 06:21 PM
Listbox on click WiReLaD Excel Programming 2 October 22nd 03 07:33 PM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"