Exporting a Worksheet as HTML

It is possible to save a workbok as HTML format and then reopen the HTML file in a browser.
Excel 2003 and 2002 both have HTML support built-in as standard.
Excel 2000 can actually use HTML as a native file format which can be saved and reopened without the loss of any information.
Macros, Charts, Pivot Tables and worksheet settings were all saved with the Excel 2000 HTML file format.
Excel 97 included a simple add-in that could be used to convert simple Excel ranges (including a chart) into simple HTML.

Two Different Formats

You can publish your worksheet in two formats:
Static - users can only view the data.
Dynamic - users can manipulate the data in their browser
Dynamic web pages are often referred to as publishing your worksheets.

Saving a Worksheet as a web page (HTML)

Create a new workbook and add some basic data and a formula to Sheet1.
Lets also include some very simple formatting as well.

microsoft excel docs

Delete all the other worksheets from this workbook so your workbook only contains one worksheet.
Select (File > Save As Web Page) to display the SaveAs dialog box.

microsoft excel docs

Make sure that you select the Entire Workbook option and enter a file name for this webpage.
When you save the entire workbook each worksheet will be saved to a separate HTMl file.
For this example we have chosen the file name "simplewebpage" and have changed the folder path to "C:\Temp\"
You can then browse to this file and open it from within Internet Explorer.

microsoft excel docs

Looking at the Source Code

For any HTML file you can have a look at the actual HTML code by selecting (View > Source).
There is too much HTML to display it all here but for such a simple example you might be surprised just how much code there is.
In this case entire workbook can be represented by a single HTML file.
This is not always the case though only for simple worksheets.
Most of the document is contained between the <head> and </head> tags.
There are also a lot of style definitions between the <style> and </style> tags.

More complicated Worksheets

When you save charts and other graphics these images (plus other files) are saved in a sub directory.
All these files are necessary to recreate the Excel workbook when the HTML file is reopend in Excel.
3 HTMl files, Gif files, CSS file and an XML file, MSO file.
If you need to transfer you HTML file to another location you must also include all the other supporting files.

Features Not Saved

The following features are lost when a workbook is saved as HTML
Custom Views
Unused number formats
Unused styles
Ddata consolidation settings
Natural Language Formulas (converted to range references)
Custom function categories
Formatting (strikethrough, superscript, subscript)
Change history
Any changes to Page SetUp
Forms toolbar (listbox and combobox settings)
Shared workbooks are no longer shared

Saving as HTML Interactive

This is when you want to save an interactive worksheet.
Saving a Worksheet as Interactive HTML
You can only save a single worksheet.

Excel 2000 can save HTML files that when displayed the browser let the user interact with it, entering and changing numbers etc.
This feature is often referred to as publishing and is only limited to a single worksheet.
(File > Save As Web Page).
In the Save As dialog box choose Selection: Sheet option and place a checkmark next to add interactivity. Click the Publish button.

microsoft excel docs

Another dialog box will be displayed. Accept the defaults and click Publish.
Now display this file in a browser.
You will see that it actually displays a worksheet like object that is interactive.
All the complexity is handled by an ActiveX control and all the information is contained in a single HTML file.
The end user must have Office 2000 installed on their computer in order to see the interactive worksheet in their browser.

There are 3 types of interactive functionality
1) Spreadsheet functionality
users can enter, calculate, sort, filter cut and paste data.

2) Pivot table functionality
users can change pivot table layout, sorting , filtering

3) Chart functionality
users can change the source data


There is a very handy wizard that can convert worksheets into HTML. Charts are currently converted to GIF images. The tables and charts, once converted are not linked.
If you select a whole worksheet and the worksheet contains a chart, the chart will not be included ?

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext