Macro execution is stopped repeatedly - How to avoid?

Asked

Viewed 4,042 times

1

When I am running a VBA macro, eventually the code is stopped, as if there were breakpoints.

The message displayed is:

Execution of code interrupted.

If you accept the message and continue executing 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?

1 answer

2


This is because VBA treated incorrectly a breakpoint which has been removed, or (more frequently) a breakpoint that was in a code snippet that was removed or moved.

Unfortunately I don’t remember where I found the solution, and it’s a hack ugly, but that solves.

  1. Accept the code break message.
  2. Click on the menu item depurar or debug (just click to open menu).
  3. Press control+Break (ou pause) twice.

Continue the macro execution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.