Stop Statement

Updated: September 2009

Suspends execution.


You can place Stop statements anywhere in procedures to suspend execution. Using the Stop statement is similar to setting a breakpoint in the code.

The Stop statement suspends execution, but it does not close any files or clear any variables.

Note Note:

The Stop statement has no effect unless the script is being debugged.

This example uses the Stop statement to suspend execution for each iteration through the For...Next loop.

Note Note:

To run this example, you must have a script debugger installed and the script must run in debug mode.

Internet Explorer 8 includes the Microsoft JScript debugger. If you are using an earlier version of Internet Explorer, see How to: Enable and Start Script Debugging from Internet Explorer.

For i = 1 To 5
   ' Print i to the Output window.
   Debug.Write "loop index is " & i
   ' Wait for user to resume.




September 2009

Modified note about script debuggers.

Content bug fix.

Community Additions