3

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.

pnuts
  • 58,317
  • 11
  • 87
  • 139
lamcro
  • 6,069
  • 18
  • 57
  • 70
  • I sounds as if macro code does not have the permission to run; the workbook is untrusted. However, I'm not sure that explains why you can create a new worksheet in the same workbook and have code run from there. In any event, I'd start in Excel Option, Trust Center (Alt+F, T, T) –  Nov 17 '15 at 15:17
  • Thanks but I already tried the Trust Center. – lamcro Nov 17 '15 at 16:43
  • Possible duplicate of [Microsoft Excel ActiveX Controls Disabled?](http://stackoverflow.com/questions/27411399/microsoft-excel-activex-controls-disabled) – Raystafarian Nov 17 '15 at 17:43

1 Answers1

1

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.

ben_h
  • 11
  • 2