Forum Discussion
ActiveX buttons unresponsive or having to be clicked twice to run macro
- HarveyWatsonNov 25, 2019Copper Contributor
If you have any other ideas, I would appreciate hearing them. I've described everything I can think of that is relevant below.
ActiveX buttons that used to work on a single click now required two clicks to activate the macro. The buttons worked fine on my previous machine which was, as far as I can tell, identical. I have dozens of spreadsheets that are affected, each spreadsheet has many buttons (15-20) so I can't replace the buttons on each one. The functionality is occurring on two machines in my department (of 4), both recently configured. The problem does not occur on the other two (older) machines in my department. The other machine in my department that has problems is a Lenovo T570.
Things I have checked for my machine:
- Hardware: Microsoft Surface model 1769
- Operating system: Windows 10
- Microsoft Excel for Office 365 MSO (16.0.12026.20344) 64 bit (previous version was 64 bit “Microsoft Excel for Office 365 MSO (16.” but I can’t prove the exact version).
The functionality is the same whether the file is opened from a SharePoint (SP) web page, a local synced folder, or on the local HD (not synced).
Two single clicks cause the macro to activate on the second click. The second click can be separated from the first by anything up to 1 minute (didn't wait any longer). If the cursor leaves the button between clicks, then it is as if the button has not been clicked. Similarly, a single click, switching windows (Alt-Tab) switching back and clicking again acts the same as a single click (does nothing).Double clicking the button is no different than single clicking. The two clicks must be separated by at least 1 second.
The problem occurred before I installed many of my custom programs so they should not be the issue.I noticed the problem on the first day I used a spreadsheet with an ActiveX control. The problem has continued on subsequent days despite reboots and cold starts (over 2 weeks now).
I followed the directions above, I tried:
- deleting \AppData\Local\Temp\Excel8.0\MSForms.exd and then re-running Excel.
- deleting MSForms.exd, rebooting, and then re-running Excel.
- deleting everything I could delete in …\AppData\Local\Temp\*.* including sub folders, rebooting, and then re-running Excel.
- AnammoxJan 15, 2020Copper Contributor
I have also tried these solutions but nothing works...
My activex button works the first click when i open excel, but stops working after that. Running the macro from inside VBA project works fine. The button seems to lose its connection with the macro. Driving me crazy, and I really don't want to replace with Form Control.
- JKPieterseJan 15, 2020Silver ContributorWhy don't you want to use the forms button?
- AnammoxJan 15, 2020Copper Contributor
Let me preface my response with the fact that I am new to VBA and coding in general. My approach to learning new things is to learn as much as I possibly can and to use tools that allow the most flexibility. My understanding is it ActiveX controls are more dynamic than form controls and so that's what I started using. At this point I'm more interested in understanding what's going on rather than identifying a workaround. I certainly could use the form buttons if I just wanted it to work.
I've also tried deleting the .exd files from Temp, restarting PC, copying everything to a new file. Other Active X buttons (linked to a different module but in the same manner) work without issue. Just this one (and its multiple copies across sheets) doesn't work.
I created a new button in a blank sheet in the same workbook and it runs the macro every time. The buttons on the original sheets still fail.
If I change the button event to MouseDown (from Click) it works.
Even if I edit the button click event sub to only include a MsgBox (rather than Application.Run "module...) it doesn't even work.
- JKPieterseJan 16, 2020Silver Contributor
Hi Anammox
Well, it is oddities like this one that keep me from using ActiveX controls. Unless there is specific functionality only these controls have to offer (like events other than click) I keep away from them. And even then, the Forms controls too have their issues. I also do not like using controls to build data entry functionality. Data validation is more robust and also works on different platforms like Excel on-line.
- AnammoxJan 16, 2020Copper ContributorI see, thanks for the guidance.
Could you give me an idea ofnhow data validation would work for data entry?
In my case I am using the button to work through a series of if statements that read values from several cells and produce a text string in another cell as a result. Not sure how to otherwise perform that task without an on demand button. - DavidPayne_LCLJun 20, 2024Copper Contributor
The issue is monitor font scaling. I got this issue when I switched seats and plugged in a new monitor. At 100% scaling I have to click on Active X buttons twice. At 125% scaling, single click. (Windows 11)