I am trying to write a simple macro to add 1 to the cell's current value:
Sub add()
MsgBox Selection.Value
Selection.Value = Selection.Value + 1
End Sub
I receive the following error message when I click a (numeric) cell and try to run the macro:
Cannot Execute in Break Mode
What am I missing?
To exit from break mode, choose Reset from the Run menu. Note that the caption in the titlebar of the VBA IDE indicates which mode is currently active. In particular, the caption contains the word “[running]” when in run mode and “[break]” when in break mode.
If you have shared a macro-enabled workbook with another user and the macros subsequently stopped working, it's possible that they accidentally re-saved it as an ordinary workbook that can't contain macros. You can see more about the different file types that Excel can save in our completely free Basic Skills E-book.
Click the File tab, and then click Options at the very bottom of the left bar. On the left-side pane, select Trust Center, and then click Trust Center Settings… . In the Trust Center dialog box, click Macro Settings on the left, select Enable all macros and click OK.
You are already executing a macro and somehow stopped its execution (e.g. due to an unhandled error or because you pressed Ctrl-Break during the execution). In this state, you cannot execute another macro.
In the Visual Basic Editor, you need to press the Stop button:
Then you can run the macro.
If you want to understand where the current execution is stopped, right click the code and select Show Next Statement. If you then press F8 you can step through the code. F5 continues the execution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With