The Immediate Window

The Immediate window serves as a convenient place to send output from a running application during development. Alternatively, you can use it to set variables when you run an application, or to check a variable's value, such as the path to the AutoCAD executable file as shown in Figure 1-9.

Figure 1-9. Executing in the Immediate window

In this example, use a question mark (?) to ask the VBAIDE to tell you a variable's value. To set a variable's value in the Immediate window, type the statement just as you would in the Code window. Figure 1-10 shows how it's done.

Figure 1-10. Setting a variable in Immediate window

Figure 1-10. Setting a variable in Immediate window

■ Note You can't declare variables in the Immediate window. Also, a variable's scope and valid VBA commands in the Immediate window are equally important. Chapter 2 covers variable scope.

Was this article helpful?

0 0

Post a comment