Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default EnableEvents = False not working ???

Code below is on the sheet where I've put ActiveX combo box named cboOthProv,
for which the linked cell is A1. If I put a stop on the very first line,
then step through, at line Range("A1") = "" execution jumps back to
the start, as if events had never been disabled.

Isn't the change to the combo box through its linked cell an event? And if
it is, then why doesn't Application.EnableEvents = False keep it from
triggering the combo box change code to begin again? This is seriously
sending me around the bend. Any clues/advice are most welcome.

Private Sub cboOthProv_Change()

Application.EnableEvents = False
Set rg = ActiveCell
t = Range("A1")
Range("A1") = ""
Select Case t
Case "Hide unselected": HideNoPicks
Case "Show unselected": UnhideNoPicks
Case "Renewal Changes": BlueNoBlue
Case "Hide Accumulators": AccHiding
Case "Show all Accums": AccUnhiding
End Select
rg.Activate
Application.EnableEvents = True


End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default EnableEvents = False not working ???

I don't know if that property applies to controls. It does apply to sheet,
workbook and application.



"B Lynn B" wrote in message
...
Code below is on the sheet where I've put ActiveX combo box named
cboOthProv,
for which the linked cell is A1. If I put a stop on the very first line,
then step through, at line Range("A1") = "" execution jumps back
to
the start, as if events had never been disabled.

Isn't the change to the combo box through its linked cell an event? And
if
it is, then why doesn't Application.EnableEvents = False keep it from
triggering the combo box change code to begin again? This is seriously
sending me around the bend. Any clues/advice are most welcome.

Private Sub cboOthProv_Change()

Application.EnableEvents = False
Set rg = ActiveCell
t = Range("A1")
Range("A1") = ""
Select Case t
Case "Hide unselected": HideNoPicks
Case "Show unselected": UnhideNoPicks
Case "Renewal Changes": BlueNoBlue
Case "Hide Accumulators": AccHiding
Case "Show all Accums": AccUnhiding
End Select
rg.Activate
Application.EnableEvents = True


End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default EnableEvents = False not working ???

Maybe this page on Chip's site will help.

http://www.cpearson.com/EXCEL/Events.aspx




"B Lynn B" wrote in message
...
Code below is on the sheet where I've put ActiveX combo box named
cboOthProv,
for which the linked cell is A1. If I put a stop on the very first line,
then step through, at line Range("A1") = "" execution jumps back
to
the start, as if events had never been disabled.

Isn't the change to the combo box through its linked cell an event? And
if
it is, then why doesn't Application.EnableEvents = False keep it from
triggering the combo box change code to begin again? This is seriously
sending me around the bend. Any clues/advice are most welcome.

Private Sub cboOthProv_Change()

Application.EnableEvents = False
Set rg = ActiveCell
t = Range("A1")
Range("A1") = ""
Select Case t
Case "Hide unselected": HideNoPicks
Case "Show unselected": UnhideNoPicks
Case "Renewal Changes": BlueNoBlue
Case "Hide Accumulators": AccHiding
Case "Show all Accums": AccUnhiding
End Select
rg.Activate
Application.EnableEvents = True


End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default EnableEvents = False not working ???

ComboBox events work even when application level events are disabled.
Workaround, at the top of the module -

Private mbExit As Boolean

In the code, replace the pair of EnableEvents lines with this

' 1st line
If mbExit then Exit sub
On Error Goto errExit
mbExit = True

'code

errExit:
mbExit = False

Regards,
Peter T

"B Lynn B" wrote in message
...
Code below is on the sheet where I've put ActiveX combo box named
cboOthProv,
for which the linked cell is A1. If I put a stop on the very first line,
then step through, at line Range("A1") = "" execution jumps back
to
the start, as if events had never been disabled.

Isn't the change to the combo box through its linked cell an event? And
if
it is, then why doesn't Application.EnableEvents = False keep it from
triggering the combo box change code to begin again? This is seriously
sending me around the bend. Any clues/advice are most welcome.

Private Sub cboOthProv_Change()

Application.EnableEvents = False
Set rg = ActiveCell
t = Range("A1")
Range("A1") = ""
Select Case t
Case "Hide unselected": HideNoPicks
Case "Show unselected": UnhideNoPicks
Case "Renewal Changes": BlueNoBlue
Case "Hide Accumulators": AccHiding
Case "Show all Accums": AccUnhiding
End Select
rg.Activate
Application.EnableEvents = True


End Sub



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 461
Default EnableEvents = False not working ???

I still use EnableEvents, like this:

Private Sub cboOthProv_Change()
If Application.EnableEvents Then

Application.EnableEvents = False
Set rg = ActiveCell
t = Range("A1")
Range("A1") = ""
Select Case t
Case "Hide unselected": HideNoPicks
Case "Show unselected": UnhideNoPicks
Case "Renewal Changes": BlueNoBlue
Case "Hide Accumulators": AccHiding
Case "Show all Accums": AccUnhiding
End Select
rg.Activate
Application.EnableEvents = True

End If
End Sub

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



On 4/22/2010 4:39 AM, Peter T wrote:
ComboBox events work even when application level events are disabled.
Workaround, at the top of the module -

Private mbExit As Boolean

In the code, replace the pair of EnableEvents lines with this

' 1st line
If mbExit then Exit sub
On Error Goto errExit
mbExit = True

'code

errExit:
mbExit = False

Regards,
Peter T

"B Lynn wrote in message
...
Code below is on the sheet where I've put ActiveX combo box named
cboOthProv,
for which the linked cell is A1. If I put a stop on the very first line,
then step through, at line Range("A1") = "" execution jumps back
to
the start, as if events had never been disabled.

Isn't the change to the combo box through its linked cell an event? And
if
it is, then why doesn't Application.EnableEvents = False keep it from
triggering the combo box change code to begin again? This is seriously
sending me around the bend. Any clues/advice are most welcome.

Private Sub cboOthProv_Change()

Application.EnableEvents = False
Set rg = ActiveCell
t = Range("A1")
Range("A1") = ""
Select Case t
Case "Hide unselected": HideNoPicks
Case "Show unselected": UnhideNoPicks
Case "Renewal Changes": BlueNoBlue
Case "Hide Accumulators": AccHiding
Case "Show all Accums": AccUnhiding
End Select
rg.Activate
Application.EnableEvents = True


End Sub



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
Application.enableevents = false not working in workbook open even oli merge Excel Programming 5 February 4th 10 04:39 PM
Application.EnableEvents = False not working modo8 Excel Programming 2 June 27th 09 02:28 AM
EnableEvents=False doesn't work? or does it? Intellihome[_30_] Excel Programming 0 June 25th 05 05:29 PM
Application.EnableEvents = False not working Paul Martin Excel Programming 3 May 10th 05 05:06 AM
object.EnableEvents = false Ajit Excel Programming 1 November 3rd 04 09:54 PM


All times are GMT +1. The time now is 08:48 AM.

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"