ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   object.EnableEvents = false (https://www.excelbanter.com/excel-programming/315699-object-enableevents-%3D-false.html)

Ajit

object.EnableEvents = false
 
As we have application.enableevents = false where we can disable the
application events...is there a similar way to disable object events....

For example in the below example : I am looking for that every time the item
is removed from the combobox/listbox it should not go to combobox/listbox
change event.

Sub unpopulate_ListBoxes(ByRef listbox_Name As ComboBox)
Dim I As Integer
If listbox_Name.ListCount 0 Then
For I = 0 To listbox_Name.ListCount - 1
listbox_Name.RemoveItem (listbox_Name.ListCount - 1)
Next I
End If
End Sub

--
Ajit

Bob Phillips[_6_]

object.EnableEvents = false
 
No, you need to create a variable and set that and test it in code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ajit" wrote in message
...
As we have application.enableevents = false where we can disable the
application events...is there a similar way to disable object events....

For example in the below example : I am looking for that every time the

item
is removed from the combobox/listbox it should not go to combobox/listbox
change event.

Sub unpopulate_ListBoxes(ByRef listbox_Name As ComboBox)
Dim I As Integer
If listbox_Name.ListCount 0 Then
For I = 0 To listbox_Name.ListCount - 1
listbox_Name.RemoveItem (listbox_Name.ListCount - 1)
Next I
End If
End Sub

--
Ajit





All times are GMT +1. The time now is 03:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com