ActiveX buttons stoped working

wagmanm

Board Regular
Joined
Feb 26, 2013
Messages
144
I was working on a Sheet and my buttons would no longer let me click them to allow the code to run. I tried to hit the start button in the code window and nothing. I reverted to old saved files and still the buttons will not work. I quit excel and have restarted my computer but none of my spreadsheets with ActiveX buttons will work. I also am unable to add a new ActiveX button as I get a Message Can not insert Object.

Does anyone know what I could have done? Or how I can fix this?

Thanks
 
I was working on a Sheet and my buttons would no longer let me click them to allow the code to run. I tried to hit the start button in the code window and nothing. I reverted to old saved files and still the buttons will not work. I quit excel and have restarted my computer but none of my spreadsheets with ActiveX buttons will work. I also am unable to add a new ActiveX button as I get a Message Can not insert Object.

Does anyone know what I could have done? Or how I can fix this?

Thanks

Hi Broken-Active-X person;

The easiest way to fix this is as follows:
a) Remove "Private" from all Excel VBA Subroutines which are executed by the Active-X buttons, (I remove all "Private" from the subroutines).
>> Note: Removal of "Private" exposes the VBA Macros to the Forms-Control buttons for assignment.

b) Replace your Active-X buttons with Forms-Control Buttons.

c) Assign the Forms-Control Button to the VBA Macro which used to be executed by the Active-X button.

All of my Excel Tools with VBA macros work just fine after such a change.

Notes:
1) Forms Control buttons DO NOT allow background colors or ability to disable/enable.

2) Forms Control buttons DO allow the ability to "hide" the button with the ".Visible" property, (i.e. ActiveSheet.Buttons("Button 24").Visible = False)

3) For button colors to show the logical buttons that are "in-play" vs. "out-of-play", I'll use a cell or merged set of cells to contain each button.
Then as I click a button that let's say "Starts" a function, I don't with the user to press "Start" a second time before pressing the "Stop" button.
So after the START button is pressed, I'll hide the button "xxx.Buttons("Button 99").Visible = False" and then turn the background cell color to Grey and turn the STOP button containing cell color to green.

wsAHTCntlPage.Cells(5, "C").Interior.ColorIndex = 48 '<== color index for grey wsAHTCntlPage.Cells(5, "F").Interior.ColorIndex = 4 '<== color index for green


I'll place text in the cell to match the button text name I gave to the button, (so the user will know what button has been hidden for context).

This works well and I've found to be the best solution unless MicroSoft has published a simple solution to allow the use of Active-X buttons after their Security Patch.

- Bill Strahl (NoahBodie_Spechell)
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,216,115
Messages
6,128,915
Members
449,478
Latest member
Davenil

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