Chapter 14 - Handling Automation Errors
Automation programming is just like other kinds of programming errors happen. However, the errors are a bit different from those you ve dealt with in a stand-alone application. Your application must be prepared to handle errors that are specific to Automation.
Most developers deal with errors that occur only in their application environment. In FoxPro (or Basic, C, or any other programming language), you set up your environment, check to be sure that any support libraries are available, then let your application run. Once your program is running, you don t have to worry about what else is installed and running on the user s computer.
Automation is a bit different. CreateObject() won t work if the Office application isn t installed, or if it is properly installed in the registry but the executable no longer resides on the disk (some users still haven t gotten the hang of uninstall programs, preferring to delete directories to free up disk space, which doesn t remove the registry settings). Once you ve created the instance and made it visible, users seem to want to close it down before your application is done with it. To make matters really annoying, none of the Office servers knows anything about the FoxPro environment, so you can t rely on SET PATH, SET DEFAULT, and other FoxPro settings.
Copyright 2000 by Tamar E. Granor and Della Martin All Rights Reserved