Immediate Window

This page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010.

Gg278736.immed_ZA01201615(en-us,office.14).gif

Allows you to:

  • Type or paste a line of code and press ENTER to run it.

  • Copy and paste the code from the Immediate window into the Code window but does not allow you to save code in the Immediate window.

The Immediate window can be dragged and positioned anywhere on your screen unless you have made it a dockable window from the Docking Tab of the Options dialog box.

You can close the window by clicking the Close box. If the Close box is not visible, double-click the Title bar to make the Close box visible, then click it.

NoteNote

In break mode, a statement in the Immediate window is executed in the context or scope that is displayed in the Procedure box. For example, if you type Print variablename, your output is the value of a local variable. This is the same as if the Print method had occurred in the procedure you were executing when the program halted.

Show: