Debugging the Model
William Preinitz · 2012
This chapter discusses how to use the debugger program to detect and correct different types of errors in the written code. There are four basic types of errors in a visual basic application (VBA) code: (1) syntax errors, (2) compile errors, (3) runtime errors, and (4) logical errors. Syntax and compile errors are always caught at the compile time. Runtime errors appear as the model is run. Logical errors generate wrong answers after the model is compiled and run. The VBA debugger is an essential tool to getting the program in running order. It helps in quickly identifying the source and cause of the errors. The VBA debugger allows examining the code statement by statement while it is running, and spying on its every action. It allows reading the values of all of the variables and looking into the nooks and crannies of every array if required. It also allows stopping, restarting, and stopping the program again and again using a variety of commands and features.