Best Practices for VBA Shops
Total Visual Code Tools makes it easier to write consistent code
If you write VB or VBA code for a living, you know there are a lot of
annoying repetitive tasks in the job. (Of course, the same is true for
almost any language). Total Visual Code Tools is designed to dispose of
some of these annoyances, and to help enforce coding standards on multi-developer
projects as well. It provides a set of builders and clean-up tools that
work in Office 2000, Office XP, and VB 6.0.
After telling TVCT about your coding standards (the prefixes you use
for variables, the commenting style you prefer, the way you like your
error handlers structured and so on), you're ready to start using the
Builders. These dialog boxes can create common code structures for you:
procedures, properties, recordset code, SELECT CASE statements, and so
on. Launch a builder, fill in some options (like the procedure name),
click a button and watch the finished code get injected directly into
your project (or, if you prefer, to the clipboard, a file, or a text editor).
TVCT also offers tools to clean up and standardize existing code, to
obfuscate code that you're ready to ship, and to manage a few other little
tasks such as block-commenting code or clearing the immediate window.
All of the standards you set up are stored in a single external file,
which makes it easy to make sure everyone on a project is using the same
standards. Another bonus for the busy shop is a help file section that
details a bunch of VBA best practices.
One of the differences between good developers and those who just hack
at the code is the tools that they use. Adding Total Visual Code Tools
to your own toolset will help you to write more consistent code -- which
will pay off in the long run as you discover that consistent code is easier
Mike Gunderloy, MCSE, MCSD, MCDBA, is a former MCP columnist and the author of numerous development books.