Creating interactive HTML files

Vertex42 The Excel Nexus

Professional Excel Templates

Get Instant Access

If you're still with me at this point, it's time to introduce yet another level of complexity. Excel can save HTML files that include spreadsheet interactivity. In other words, when the HTML file is displayed in a browser, the user can actually interact with the document as a spreadsheet — enter data, change formulas, adjust cell formatting, see "live" charts, and even drag data around in pivot tables.

In Excel 2003, you can create an HTML file with interactivity from a multisheet workbook. In previous versions, interactive HTML files were limited to a single sheet.

To get a feel for how this works, activate a sheet that contains formulas. Choose the File ^ Save as Web Page command. In the Save As dialog box, choose the Selection: Sheet option and then enable the Add Interactivity check box. Click the Publish button. You'll get another dialog box (Publish as Web Page). Accept the defaults and then click Publish.

Spreadsheets that are saved with interactivity are readable only by Microsoft Internet Explorer.

When you open the HTML file in Internet Explorer, you'll find that it displays a spreadsheet-like object that is, in fact, interactive. You can change the values and even edit the formulas. Figure 4-2 shows an example.

3 C:\Documents and SettingsVJohn\Desktop\inortgage2.htm - Microsoll Internet Explor

File Edit View Favorites Tools Help

Back Forward Stop Refresh Home y L:\Documents and Setbngsyohn'iDesktop^mortgagei.hl

Mortgage Loan Calculator


•o I j, fe a I £ mi





Mortgage Loan Calculator


Purchase Price:



Down Payment Percent:



Loan Amount:

S 196,000


Interest Rate:



Loan Term [Months]:



Calculated Monthly Payment:



< I


Figure 4-2: An example of an interactive Excel worksheet displayed in Internet Explorer.

What about the Script Editor?

You'll find that this book ignores one complete aspect of Excel: the Microsoft Script Editor, which you access by pressing Alt+Shift+F11. The Script Editor is used to edit the JavaScript (or VBScript) code in an HTML document. I consider this topic to be beyond the scope of this book as well as useful to only a very small number of readers. In fact, I have never been in contact with anyone who had any interest at all in this topic. Consequently, I focus on the real meat of Excel: non-Web-based application development by using VBA.

You might expect that the HTML file generated for an interactive worksheet would be much more complex than the example in the previous section. You'd be wrong. Such a worksheet occupies a single HTML file. The complexity is handled by an ActiveX control. Because of this, the end user must have Office 2000 or later installed (or have a license for the Microsoft Office Web Components ActiveX control) to view an interactive Excel file in Internet Explorer.

This section was intended to provide a brief overview of the HTML feature in Excel 2000 and later. This topic is definitely fodder for a complete book— one that I don't choose to write, thank you.

Was this article helpful?

0 0

Post a comment