Host your Web site with PureHost! |
![]() ![]() Wednesday, June 17, 2009 – Permalink – VBA Variable ProblemsExplicit protectionIt's good practice to always use the Option Explicit statement in the beginning of your code modules to ensure that all variables are unambiguously declared in your procedures. With this process in place, you'll receive a "Variable not defined" error if you try to execute code containing undeclared variables. Without this statement, it's possible to mistype variable names, which would be interpreted as new Variant type variables. This could severely impact the results of your code, and you might not ever know it. If you do find a problem, tracking down where the error is can be a chore. Although you can manually type the statement into your modules, changing a setting in Access can ensure that the statement is always added to new modules.
[Edited entry from 5/2/2006] See all Topics Labels: Access, Excel, PowerPoint, Word <Doug Klippert@ 3:33 AM |