I can no longer run my subroutines

Sparkle99

Board Regular
Joined
May 22, 2009
Messages
119
Microsoft 365, in November I wrote some VBA code and have it running fine from a Command Button.
I've just re-opened the XLSM file and the macros are not visible and the button doesn't 'press'.
When I 'view code' I can see the routines are there all fine - nothing is lost - but why won't it run?
This is on my PC, I have Trust Centre options enabled, Trusted Locations set etc...
It WAS working fine. I can only assume a Windows or Office update has done something, but how can I re-enable my code?
 

Attachments

  • button.png
    button.png
    5.1 KB · Views: 8
  • Code.png
    Code.png
    20.2 KB · Views: 8
  • button2.png
    button2.png
    35.3 KB · Views: 6
  • macros.png
    macros.png
    17.5 KB · Views: 8

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Do you have to enter Design mode to select the button as in that third picture, or is that what happens when you just click on it normally?

Also, can you run the macros from the macros dialog?
 
Upvote 0
Solution
Do you have to enter Design mode to select the button as in that third picture, or is that what happens when you just click on it normally?

Also, can you run the macros from the macros dialog?
Hi, thanks for the reply.
I can use designer mode - the button used to 'press in' but now is just a red block that does nothing when clicked.
I can run the code from the editor, but not from the Macros window as they don't show in there (might be because they are Private SUB's?)
 
Upvote 0
I can use designer mode - the button used to 'press in' but now is just a red block that does nothing when clicked
What I am asking is whether the button itself gets selected when you click on it without choosing design mode?
 
Upvote 0
What I am asking is whether the button itself gets selected when you click on it without choosing design mode?
Clicking the CommandButton Object (!) with Design mode off does nothing now. No animation. Previously, it used to depress like a button and run the routine. I'm thinking there's some new level of security/permission at play here.
 
Upvote 0
If you add a new activex button to the sheet, is it clickable?
 
Upvote 0
If you add a new activex button to the sheet, is it clickable?
Debugging all of this - or "faffing about" - seems to have solved it.
I can now add a new button and double-clicking it creates me a new code block...
Private Sub Verify2_Click()
End Sub

The existing buttons that weren't working or behaving like buttons are now working fine and running my code.

I realise now that Private routines don't appear in the Macro list, so this was a red-herring anyway.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,607
Members
449,090
Latest member
vivek chauhan

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