-
cancel button click events
I have a button on my excel file. When someone clicks on the button and I run a long process. During this time, I want to disable any events fired from that specific button. For example if user keeps clicking the button multiple times, I would like to just ignore them until I finish running the process.
I tried many suggestions I found on the web
1. Application.EnableEvents = False
2. ActiveSheet.Buttons("Button1").Enable = False
Unfortunately, it looks like if the user clicked on the button 5 times, the event still get processed 5 times.
I have attached a test spreadsheet to this message.
Your help will be greatly appreciated.
-
I didn't look at your code but it might be easier to use a Control Toolbox button.
[VBA]Private Sub CommandButton1_Click()
Dim lng As Long, t1 As Double
CommandButton1.Visible = False
t1 = Timer
For lng = 1 To 10000
Cells(lng, "a").Value = lng
Next lng
MsgBox Timer - t1
CommandButton1.Visible = True
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules