Opening .xls in Excel, not IE

C

Cranky

Hi

I'm not sure if I should be asking here, or in an Excel group.

I have several .xls files for recording office data on an intranet,
and have been recently using FP to put together a page for linking
them together. When I click, on, say "April", the April spreadsheet
opens in Explorer.

Is there any way of opening the .xls file in Excel when I click on the
IE hyperlink?

Thanks in advance

S:)
 
2

2DC

Cranky:

There are a couple of options to consider. If you are passing the name of
the Excel spreadsheet as a parameter to a URL, use the following code:

// Define a new array to hold the parameters passed on the request
var qsParm = new Array();
var objExcel;
var strLocation;
/* Search through the URL and get the parameter key and the parameter value
and load them into the array */
function parseParameters() {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms.indexOf('=');
if (pos > 0) {
var key = parms.substring(0,pos);
var val = parms.substring(pos+1);
qsParm[key] = val;
}
}
}


function OpenWorkbook(strLocation){
objExcel = new ActiveXObject("Excel.Application");
objExcel.Visible = true;
objExcel.Workbooks.Open(strLocation);
objExcel.UserControl = true;
}
// Envoke the function to parse the URL parameters
parseParameters();
/* Based on the report name passed in the URL, open a new Excel session
with the requested spreadsheet */
OpenWorkbook(qsParm['workbook']);
history.back();


If you want to open the file directly from within a page, try this:

var objExcel;
var strLocation;

function OpenWorkbook(strLocation){
objExcel = new ActiveXObject("Excel.Application");
objExcel.Visible = true;
objExcel.Workbooks.Open(strLocation);
objExcel.UserControl = true;
}

Regards . . ..
 
Top