Integrating Your Add-In with Microsoft Excel

As discussed earlier, your add-in is really just a specialized macro that's running in Microsoft Excel. It's very important that you write quality code, test it well, and maximize your maintainability by using efficient coding techniques. VBA doesn't force you to use any standards, but adopting the principles adapted from developers with years of experience can make your project much easier to build and maintain.

From the user's perspective, it is very important that your add-in integrate cleanly with Microsoft Excel. Your menus should mimic Microsoft Excel's built-in menus, and your toolbars should look and feel as if they came from Microsoft. Always provide shortcut keys (also known as accelerators) in dialog boxes.

Your interface design (UserForms as dialog boxes) should look and feel as if it were a built-in part of Microsoft Excel. For all dialog box design considerations, try to find an existing Microsoft Excel dialog box to use as a model. For example, where do you put the OK and Cancel buttons? Microsoft Excel generally places them in the upper-right part of the dialog box, but multistep Wizards have them across the bottom. Be sure your design is as close to a built-in dialog box as possible.

While you should use good coding techniques and write efficient code, your final work tends to be judged by your user interface. This is not always fair or accurate, but the user can't see the care taken behind the scenes. The combination of a great interface with great code in the background adds up to an outstanding add-in. Plan on using the techniques outlined in this chapter, but be sure you also do plenty of interface testing. This care and optimization provides a cleaner solution and a stronger foundation for future growth.