![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 03:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com