Workbooks

A Microsoft Excel workbook that contains data in more than one worksheet, or contains blank worksheets before the worksheet containing data, is stored as a frameset of two frames: a worksheet frame and a worksheet navigation tab frame. The frameset HTML file contains information about the workbook, links to supporting documents, and the frameset definition. The worksheet frame contains the active worksheet HTML file. Each worksheet is stored in an HTML file. The tab frame is stored in an HTML file and contains the tabs that allow the user to display each worksheet.

A workbook is saved in a single HTML file if the first worksheet contains data and all other worksheets are blank. In both cases, additional supporting files such as images might be created when the workbook is saved as a Web page. The structure of the workbook and worksheet HTML files is described in the Office HTML and XML File Format topic. Worksheet tables are described in the Worksheets topic. For a list of supporting files and where they are saved, see the Folder and File Names topic.

Workbook properties are contained in the ExcelWorkbook element. Worksheet properties are contained in the ExcelWorksheet element, either in the ExcelWorkbook element in a single HTML file, or in the worksheet frame HTML file. If worksheet properties are specified but no data is specified, the worksheet is blank when the workbook is opened in Excel.

The following example shows the general structure of the frameset elements in a workbook frameset file.


<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name="Excel Workbook Frameset">
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 9">
<link rel=File-List href="./Book1/filelist.xml">
<link rel=Edit-Time-Data href="./Book1/editdata.mso">
<link rel=OLE-Object-Data href="./Book1/oledata.mso">
.
.
.
<link id="shLink" href="./Book1/sheet001.htm">
<link id="shLink" href="./Book1/sheet002.htm">
<link id="shLink" href="./Book1/sheet003.htm">
.
.
.
</head>
<frameset rows="*,39" border=0 width=0 frameborder=no framespacing=0>
 <frame src="./Book1/sheet001.htm" name="frSheet">
 <frame src="./Book1/tabstrip.htm" name="frTabs" marginwidth=0 marginheight=0>
 <noframes>
  <body>
   <p>This page uses frames, but your browser doesn't support them.</p>
  </body>
 </noframes>
</frameset>
</html>

If the user attempts to open a worksheet or tab frame HTML file in a Web browser or Excel, the workbook frameset HTML file is opened. Script directs the Web browser or Excel to the frameset only when the worksheet file is opened outside the worksheet frame. When a worksheet file is opened in Excel using the File Open dialog box, the parent workbook is opened with the specified worksheet as the current worksheet. The parent document is specified by an HTML Link element.

The following example shows the script used in the sheet001.htm worksheet file to direct the Web browser or Excel to open Book1.htm.


<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 9">
<link id=Main-File rel=Main-File href="../Book1.htm">
<link rel=File-List href=filelist.xml>
<link rel=Edit-Time-Data href=editdata.mso>
<link rel=Stylesheet href=st.css>
<style>
.
.
.
</style>
<![if !supportTabStrip]><script language="JavaScript">
<!--
.
.
.
if (window.name!="frSheet")
 window.location.replace("../Book1.htm");
else
 fnUpdateTabs();
//-->
</script>
.
.
.
</head>
<body link=blue vlink=purple>
.
.
.
</body>
</html>