Design for Portability

When it comes to Excel applications, portability should be an important design consideration. That is, aim to develop Excel applications that don't make any assumptions regarding the location from which they are running. An application should not care which computer it runs on, where the workbook is stored on the filesystem, or make any assumptions about the location of other files other than relative paths (which should be user configurable). There are many reasons why it behooves you to follow this advice.

In the corporate world, Excel workbooks are nearly equivalent to Adobe Acrobat files (*.pdf) in terms of portability. They are e-mailed, shared on file servers, and posted to the corporate intranet. Excel and the other Microsoft Office applications are often mediums of collaboration. In fact, Microsoft is touting collaboration as a key benefit of the Office 2003 system. In this environment, portability is paramount. Ideally, an Excel application contains everything it needs to work within the workbook. If so, you can distribute your Excel application much the same as you would any other workbook.

In addition to the vast amount of collaboration and sharing that occurs with Excel workbooks, many people have more than one computer. They may have a laptop and a desktop computer, or a work computer and a home computer. In either of these scenarios, chances are that they often transfer files between the two computers. You can make it much easier on your users by designing an application that doesn't require any special setup procedures or installation process.

Finally, chances are that the version of Microsoft Windows you use is geared toward supporting multiple users on the same computer. In order to support this capability, each user's files should be kept separate from other users' files. In order to play by the rules, your application shouldn't force users to store user-specific information in a "common" file location. For example, it shouldn't force everyone to store their files in a folder named C:\Excel App1ication\Reports.

Tips for Creating Portable Applications

So what can you do to create portable applications? Here are a few things to keep in mind when coding for workbook portability.

♦ Use configurable relative paths to any application-specific folders. It is easy to allow the user to choose the names of these folders.

♦ If you do use application-specific folders, check for the presence of these folders in the Workbook Open event. If they don't exist, offer to create them.

♦ Always validate file locations and check to make sure files exist before using them.

♦ Avoid using registry keys or INI files.

♦ If you can't create a portable application, provide a way for users to export key sections of the workbook (such as reports) to code- and link-free workbooks.

0 0

Post a comment