How to delete the message "The execution of the code has been interrupted." in VBA

3

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.03.2016 / 21:20

1 answer

1

Enter the expressions below into your code:

Application.EnableCancelKey = wdCancelDisabled

(... code ...)

Application.EnableCancelKey = wdCancelInterrupt
    
29.03.2016 / 21:23