Having to click ActiveX Button twice to do something

ArnMan

Board Regular
Joined
Aug 30, 2017
Messages
69
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello,
I have a couple of ActiveX buttons and if I repeatedly click any of the buttons, I have to click twice in order for it to execute. I can click, go fill out a cell somewhere and come back and I can click once. but If I just try to execute a macro several times I have to click twice.
Is there something I can put in my code to make it stop doing that?

Thank you in advance.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi there, In the properties for the activex button, try setting Take Focus On Click to false.
John
 
Last edited:
Upvote 0
Hi there, In the properties for the activex button, try setting Take Focus On Click to false.
John


Hello, thank you for answering so fast. I did try that but I think I figured out what is going on. Whether the focus is True or False. It still does it, but, only when I click too fast. If I repeatedly click the button at a fast rate, it apparently doesnt have time to reset itself. If I click slowly waiting about a second or two between clicks it works on every click. It would be nice if it Execute the function faster, but I can live with clicking slower.
 
Upvote 0
I know this thread is old, but will hopefully help others, as this issue has been bugging me for a couple of days.

I got this issue as a result of changing to Windows 10 and a spreadsheet that was developed under Windows 7 started to get this issue (had worked perfectly before). I still can't find a definitive way to solve it, but do have a work-around.
1. In Design Mode, select the button and set 'TakeFocusOnClick' to True
2. In the code corresponding to the button rather than using the normal Private Sub_CommandButton1_Click() use Private Sub CommandButton1_GotFocus()

I know a similar issue can result with Form buttons and this won't work, but does seem to do the job for ActiveX controls.

Hope it helps.
Lively.
 
Upvote 2
FYI for anyone else searching for this, the above solution by *Lively was successful and worked for me.
 
Upvote 0
I had this same problem on my user form, the issue was because my mathematical equations were out of sync in my coding. For example, If I had a macro summing “2+2=4” then contained in that same macro I’m taking the total of “4”and using it for another calculation, I had had to click the button twice because it was trying to use the total of “4” before it had a chance to sum “2+2=4” I just rearranged the sequence of my coding until it only took 1 click
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top