HOWTO: Link to a Sheet, or Named Area, of an Excel File in HTMLID: Q197922
|
There may be times when you want to use links or JScript in a Web page to
offer quick access to different parts of an Excel Document. For example,
you might offer departmental statistics on an intranet site that links
easily to charts or previous months' reports in the same document.
You can open an Excel 97 file to a named area, or any sheet and cell from a
anchor link or script in an HTML page as long as the HTML page is accessed
via http ( not by double-clicking it in Windows Explorer, nor using
file://) and Excel is opened within the browser. If Excel is opened outside
of the browser, it will not move to the specified link.
The syntax is based on standard Excel syntax. You can use this method in a
frame declaration, an anchor tag, or even in script when using
location.href.
This HTML demonstrates how the links and Jscript look:
<HTML>
<HEAD>
<Title>Excel Linking Example</Title>
</HEAD>
<body>
<p>
<a href="http://localhost/excel/asheet.xls#Sheet2!D4">
This link will open the Excel file to the second page with the focus on
cell D4</a>.
<a href="http://localhost/excel/asheet.xls#TableName">
This link will set the focus on a named area of the spreadsheet
</a>.
</p>
<form>
<input type=button
value="Via Jscript"
onclick='location.href = "asheet.xls#TableName"'>
</form>
</body>
</html>
Make sure you create an Excel file with a named cell, and change the HTML
above to reflect the name of your Excel file, and the named area.
For additional information, please see the following articles in the Microsoft Knowledge Base:
Q178222 HOWTO: Launch Word from Internet Explorer
Q185978 BUG: Double GET and Cookies Lost with Word or Excel
Q162059 Office Documents Open in Internet Explorer
Q157417 XL97: Unable to Use File URL in Linking Formulas
Q189155 XL98: Unable to Use File URL in Linking Formulas
Additional query words:
Keywords : kbIE300 kbIE301 kbIE400 kbIE401 kbIE302 kbIE401sp1 kbIE500dp1 kbIE500
Version : WINDOWS:3.0,3.01,3.02,4.0,4.01,4.01 SP1,4.01 SP2,5.0,5.0dp1,5_beta
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: April 28, 1999