Optimization is the process of reviewing your operating environment, Visual Basic for Applications (VBA) code, application objects, and data structures to ensure that they are providing optimum performance. In a nutshell, optimization is the process of making your application leaner and meaner.
Users become frustrated when an application runs slowly. In fact, if a user is not warned about a slow process, he will often reboot or shut down the power on the machine while a process is running. This can have dire results on the integrity of the data.
TIP
To help reduce the chance of users rebooting the computer during a lengthy process, it's generally a good idea to provide them with some sort of indication that a process will take a while. You can do this by using a message box that appears before processing begins, or by providing a status bar or progress meter that shows the progress of the task being completed.
You can do many things to optimize an application's performance, ranging from using a front-end tool such as the Performance Analyzer, to fastidiously adhering to certain coding techniques. This chapter highlights the major things you can do to optimize the performance of your applications.