How to delete "Code execution stopped." message in VBA

Asked

Viewed 1,667 times

3

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

1

Insert the following expressions into your code:

Application.EnableCancelKey = wdCancelDisabled

(... code ...)

Application.EnableCancelKey = wdCancelInterrupt
  • 1

    Nice of you to join us and help. It is the tip of [Dit] the answer and give a small complement explaining what causes the problem and how the solution solves, this would greatly value the post. And welcome to Sopt!

Browser other questions tagged

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