Chapter 18

Building Well-Behaved Code

Once you’ve built a procedure that’s useful and that works consistently as intended, you’ll probably want to distribute it to as many of your coworkers as might use it or even to a wider audience on the Internet. Before you distribute it, though, you should make sure that the procedure is as civilized as possible in its interaction with users and with the settings they may have chosen on their computer. It’s all too easy to distribute an apparently successful procedure that runs roughshod over the user’s preferences or one that fails unexpectedly under certain circumstances. In this chapter, you’ll look at how to avoid such problems and how to construct your procedures so that the user will have no problem ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.