PDA

View Full Version : IE Hyperlink to Excel Document


Windle Poons
2nd Nov 2004, 12:36
I am currently setting up a site on our Intranet that accesses information from various types of document on various servers. One of the documents is an Excel spreadsheet which has worksheets named after the months, i.e. 'Jan' 'Feb' 'Mar 'Apr' etc.

I am trying to find some code (javascript, html or otherwise) that will allow a hyperlink from the Intranet site to not only open the Excel document, but at the worksheet relevant to the current month.

My own attempts at the code have failed :*, so any help from fellow prooners would be much appreciated.

WP.

Windle Poons
2nd Nov 2004, 14:19
I should add that the hyperlink is from a drop down menu, and I have had a go at the code myself, which is at the bottom of this post. The menu bit works, but the added bit for the month specific worksheet makes it fall over........

WP.

<form name="navigation" style="position: absolute; margin-top: -12">
<select name="calloutmenu" size="1">
<option value="w:/ops/spectre/excel/ocpilot.xls">Pilot</option>
<option value="w:/ops/spectre/excel/ocobserver1.xls">Obs1</option>
<option value="w:/ops/spectre/excel/ocobserver2.xls">Obs2</option>
<option value="w:/ops//spectre/excel/ocaircraft.xls">Aircraft</option>
</select>&nbsp;<input type="button" value="Go!" onClick="jumpbox()">
</form>

<script language="javascript">
<!--

var openmode=1
var targetframe="main"

function jumpbox(){
today = newDate();
cmonth = new Array(
"#January!A1","#February!A1","#March!A1","#April!A1",
"#May!A1","#June!A1","#July!A1","#August!A1",
"#September!A1","#October!A1","#November!A1","#December!A1"
);
var destination=eval("window.parent."+targetframe)
var ddbox=document.navigation
if (openmode==2)
destination=window.parent
destination.location=
ddbox.calloutmenu.options[ddbox.calloutmenu.selectedIndex].value.cmonth[today.getMonth()]
}
//-->
</script>