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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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 1
FYI for anyone else searching for this, the above solution by *Lively was successful and worked for me.
 
Upvote 0

Forum statistics

Threads
1,214,575
Messages
6,120,342
Members
448,956
Latest member
Adamsxl

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