Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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
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
Events won't Disable! roadkill Excel Discussion (Misc queries) 2 April 26th 06 04:36 PM
disable events does not work Mika Excel Programming 3 October 15th 05 02:09 PM
disable events while macro is running ben Excel Programming 5 January 24th 05 05:19 PM
Disable Events wiwi Excel Programming 3 December 29th 03 04:53 PM
Disable Key Events Seth[_3_] Excel Programming 1 October 6th 03 10:28 PM


All times are GMT +1. The time now is 10:32 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"