Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command Button not working

I have an Excel 2010 spreadsheet with VBA code. When I try using it in Excel 2013 some strange stuff happens:

The Command Buttons on the existing worksheets stopped working. The VBA code associated to them does not run. Not even an error message appears.

I tried adding a new Command Button to an existing worksheet, but it does not run either.

But, if I create a new worksheet in the spreadsheet, and add a Command Button in it, the button executes with no problems.

like image 438
lamcro Avatar asked Apr 29 '26 03:04

lamcro


1 Answers

I'm using Excel 2016 but I think I ran into a similar problem. I put a command button into the worksheet and then the code did not run when I pressed the button. I discovered that I was still in "Design Mode". In the Controls group of commands in the Developer tab the "Design Mode" button was still grayed out. I clicked it to turn off Design Mode and then the code started running when I clicked the button. In short I was still in Design Mode (for the actual design and layout of the buttons) when I was initially trying to get the button to work. It did not work. I exited Design Mode and then the button worked. This may not be helpful to the person asking the question as they already had the buttons in the workbook. However it may help someone who stumbled upon this question because they had problems getting the button to work initially.

like image 177
ben_h Avatar answered Apr 30 '26 18:04

ben_h



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!