Excel Accelerated Buttons Working Only Once

DHero

New Member
Joined
Sep 22, 2021
Messages
19
Office Version
  1. 365
Platform
  1. Windows
I've developed a simple user form with a bunch of buttons that, when pressed, play a sound. I've also assigned a custom "accelerate" key to each button in a manner which when I press Alt + key the button is activated. The problem is, this happens only once for each button! Every subsequent activation through the accelerate key return an error beep. How to make it so the activation of the buttons canh be repeated in this way?

Some reference follows:
Redirecting (For the custom sounds)
Rich (BB code):
Private Sub CommandButton1_Click()
        Me.CommandButton1.Accelerator = A
        Beep 800, 300
        Me.CommandButton1.SetFocus
End Sub
Code snippet for the buttons, they all look the same.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I've figured it out. By using the line "Me.CommandButton1.Accelerator = A" on every button it was, somehow, redefining the shortcut for acceleration. Removing it and defining the shortcut through the properties window works fine.
 
Upvote 0
Solution

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

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