VBATrain.com
Chapter 1 The Visual Basic Editor Page 9 of 11

   VBATrain Home    |    Sample Lessons Index    |   Previous Page    |   Next Page


Stepping Through Code in Break Mode

When you are writing VBA and building Excel applications, you may spend a lot of time stepping through code. What does that mean?

Normally, code is triggered by some event (like a button being clicked), then the processing dictated by the code runs and completes.  The user never sees the code, only the results of it running.

In break mode, the code can be “stepped through” in various ways. This allows you, as the programmer, to control the step-by-step running of the code. You can cause the processing to execute a single code line at at time or cause processing to stop at key locations in the program. This allows you to scrutinize code performance as the code is running. It is like watching a film frame by frame or in slow motion, with the capability of stopping the film at any frame. This is an important feature of the VB Editor and a great help for debugging programs.

FLASH EXERCISE:
  1. Go back to the VB Editor to the session where you wrote the sheet activation code; it should look something like the picture below.
  2. Start the Flash Exercise below and follow the directions. You will step through the code you wrote in the earlier lesson.
        Stepping through code


Object vs. Sheet




   VBATrain Home    |    Sample Lessons Index    |   Previous Page    |   Next Page

Click here for feedback and questions about this chapter.

Copyright © 2006-2008 J. Donald McClenagan, PhD, ALL RIGHTS RESERVED