Forum Discussion
Ploughguy
Apr 10, 2021Copper Contributor
How can I interrupt a long-running macro in Excel 360 on a Mac?
Any thoughts? The interwebs are strangely silent on the matter. Just want to kill it, but preferably not blow away Excel itself. All the toolbar buttons are grey or unresponsive. Excel reports 10...
- Apr 10, 2021
Try pressing Esc or Command+. (point)
If that doesn't work, Excel is executing a "tight" loop that can only be interrupted by quitting Excel.
HansVogelaar
Apr 10, 2021MVP
Try pressing Esc or Command+. (point)
If that doesn't work, Excel is executing a "tight" loop that can only be interrupted by quitting Excel.
Ploughguy
Apr 10, 2021Copper Contributor
Yep - tried both of those. I have yet to find a situation where they actually do something.
Having to blow up Excel to stop a macro seems a bit 20th Century. They should get an intern to work or the problem as a holiday project...
Thanks for the help, though. It gives some reassurance that the problem is at their end rather than at my end.
Having to blow up Excel to stop a macro seems a bit 20th Century. They should get an intern to work or the problem as a holiday project...
Thanks for the help, though. It gives some reassurance that the problem is at their end rather than at my end.
- HansVogelaarApr 10, 2021MVP
You can insert a line
DoEvents
inside a loop. This will slow down execution slightly, but it will ensure that you can interrupt code execution by pressing Command+. or Esc.
- PloughguyApr 11, 2021Copper ContributorWell I never. Well, not until now.
This looks like one of those things that seemed like a good idea in the 1990s but now just evokes dreadful pangs of remorse.
Hans, thank you! I will bury it in every loop.
A preference setting that enables a check after every statement (as it should always have been) sounds like a useful Christmas wish. And just for completeness, Events Off and Events On.