Excel 2007 Power Programming with VBA (Mr. Spreadsheets Bookshelf)

This section describes two ways to display user help in a Web browser.

Using HTML files

Yet another way to display help for an Excel application is to create one or more HTML files and provide a hyperlink that displays the file in the default Web browser. The HTML files can be stored locally or on your corporate intranet. You can create the hyperlink to the help file in a cell (macros not required). Figure 24-7 shows an example of help in a browser.

Figure 24-7: Displaying help in a Web browser.

Easy-to-use HTML editors are readily available, and your HTML-based help system can be as simple or as complex as necessary. A disadvantage is that you may need to distribute a large number of HTML files. One solution to this problem is to use an MHTML file, which I describe next .

CD-ROM  

A workbook that demonstrates this technique is available on the companion CD-ROM. The filename is web browser\formletter.xlsm .

Using an MHTML file

MHTML, which stands for MIME Hypertext Markup Language, is a Web archive format. MHTML files can be displayed by Microsoft Internet Explorer.

The nice thing about using an MHTML file for an Excel Help system is that you can create these files in Excel. Just create your help text using any number of worksheets. Then, choose Office Save As, click the Save As Type drop-down list, and select Single File Web Page (*.mht; *.mhtml). VBA macros are not saved in this format.

Figure 24-8 shows an MHTML file displayed in Internet Explorer.

Figure 24-8: Displaying an MHTML file in a Web browser.

In Excel, you can create a hyperlink to display the MHTML file.

CD-ROM  

A workbook that demonstrates this technique is available on the companion CD-ROM. The filename is mhtml file\formletter.xlsm .

Note  

If you save a multisheet Excel workbook as an MHTML file, the file will contain Javascript code - which may generate a security warning when the file is opened.

Категории