Create your Debug Flag

It's a good idea to create a global constant for debugging (for example: Dim Constant bDEBUG = True|False) and set up your error handling so you can turn specific error trapping on or off depending on the value of your constant. Before sending your add-in to be tested, you can set the constant to False and your project will handle errors in the exact manner your users will see. Sometimes a second flag is appropriate if you wish to turn on or off logging functions embedded in your code, and you want this code to run in both the debug and non-debug mode.

The use of a bDEBUG flag has many other applications. You can display developer-only message boxes, write to development-only log files, and/or control other operations you may wish to have available conditionally during development.