User interface related code only in User Forms
A common practice for beginning developers is to place the macro processing code in the OK (or Apply) button click event sub of a User Form. While this may be easy, and keeps everything in one spot, it is not recommended. The only code in your User Forms should be the code required to collect and verify user inputs.
The actual processing code for your macros should be placed in separate code and/or class modules. Designing your processing code with multiple functions and subs divided logically in to different modules and classes promotes reusability and portability.
One Response to “User interface related code only in User Forms”
Envision Newsletter April 2011 - Envision CAD | MicroStation Training & InRoads Training Says:
[…] VBA: User interface related code only in User Forms […]