Running a script step by step

<< Click to Display Table of Contents >>

Running a script step by step

The following commands enable you to run a script step by step:

Trace (keyboard shortcut: F7)

When you invoke the ribbon command Home | Program group | Trace, only a single line of the script runs and execution halts. If you invoke this command again, the next line will run, then execution halts again, etc.

This allows you to execute a script line by line in single steps.

Procedure step (keyboard shortcut: F8)

The ribbon command Home | Program group | Step also executes only one line of the script and then stops execution.

The difference between this and the Trace command: Procedures are not processed line by line, but as a whole.

Explanation: If you invoke a procedure (a function or a sub) in your code, then Trace will go into this procedure, run the first statement and then wait. Step will treat the whole procedure as a single statement and process it as a whole before pausing.

Reset (keyboard shortcut: Ctrl+F2)

The ribbon command Home | Program group | Reset aborts the single-step execution and resets the script to the first line.