Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable events
I am using Application.EnableEvents to stop userform controls being active
during file processing activity. I then re-enable them after the process is complete. Can someone advise if the control activities are recorded in a buffer or in some way can be captured - even though they do not fire any code attached to them? -- Cheers Nigel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable events
Hello Nigel,
I am taking a guess as to the why of your question... Application.EnableEvents has no effect on controls in a UserForm. A solution is to use a Public variable say...blnDisable. Set the value of the variable to true when you what to stop form events. Then in the code for each control you can use something like... Private Sub CommandButton1_Click() If blnDisable Then exit Sub 'or if you want to keep track ' If blnDisable Then ' Counter = Counter + 1 ' Exit Sub ' End if 'other stuff End Sub Regards, Jim Cone San Francisco, USA Free add-ins... http://www.realezsites.com/bus/primitivesoftware "Nigel" wrote in message I am using Application.EnableEvents to stop userform controls being active during file processing activity. I then re-enable them after the process is complete. Can someone advise if the control activities are recorded in a buffer or in some way can be captured - even though they do not fire any code attached to them? Cheers Nigel |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable events
Thanks Jim, I was pulling my hair out trying to figure out why things were
behaving the way they were. Your reply clears it up. Many thanks -- Cheers Nigel "Jim Cone" wrote in message ... Hello Nigel, I am taking a guess as to the why of your question... Application.EnableEvents has no effect on controls in a UserForm. A solution is to use a Public variable say...blnDisable. Set the value of the variable to true when you what to stop form events. Then in the code for each control you can use something like... Private Sub CommandButton1_Click() If blnDisable Then exit Sub 'or if you want to keep track ' If blnDisable Then ' Counter = Counter + 1 ' Exit Sub ' End if 'other stuff End Sub Regards, Jim Cone San Francisco, USA Free add-ins... http://www.realezsites.com/bus/primitivesoftware "Nigel" wrote in message I am using Application.EnableEvents to stop userform controls being active during file processing activity. I then re-enable them after the process is complete. Can someone advise if the control activities are recorded in a buffer or in some way can be captured - even though they do not fire any code attached to them? Cheers Nigel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Events won't Disable! | Excel Discussion (Misc queries) | |||
disable events does not work | Excel Programming | |||
disable events while macro is running | Excel Programming | |||
Disable Events | Excel Programming | |||
Disable Key Events | Excel Programming |