Macro execution is interrupted repeatedly - How to avoid? [closed]

1

When I'm running a VBA macro, eventually the code is interrupted, as if there were breakpoints .

The message displayed is:

  

The code execution has been stopped.

If you accept the message and continue running the code, the behavior repeats if the macro is long (procedure with many lines or long loops).

The interruption happens in several places.

How can I avoid / resolve this behavior?

    
asked by anonymous 29.09.2015 / 20:18

1 answer

1

This is because VBA incorrectly handled a breakpoint that was removed, or (more often) a breakpoint that was in a snippet of code that was removed or moved.

Unfortunately, I do not remember where I found the solution, and it's an ugly, hack that solves it.

  • Accept the code interrupt message.
  • Click the menu item depurar or debug (just click to open the menu).
  • Press% with% twice .
  • Continue to run the macro.

        
    29.09.2015 / 20:18