G
Guido Van der Elst
I am trying to code the following:
I open an Excel sheet with ActiveX from Inet Explorer 5+ with a form button.
I go to the Excel window and make a few changes.
Then I go back to the Explorer window and want to capture some cell
information from the Excel sheet.
But then I get an "ExcelApp is undefined" error.
Can someone give me some ideas on how to solve this?
here is the code:
<html>
<head>
<script language="JavaScript">
function openxlspage() {
ExcelApp = new ActiveXObject("Excel.Application");
ExcelApp.DisplayAlerts = false;
ExcelApp.Workbooks.Open("http://servername/path/mysheet.xls", 3, false);
ExcelApp.visible = true;
}
function getxlspagevalues() {
ExcelApp.Workbooks(1).SaveAs("C:\\TEST.XLS");
}
</script>
</head>
<body>
<form name="formName">
<input TYPE="submit" NAME="openXLSbutton" VALUE="Open XLS"
onclick="openxlspage();">
</form>
<form name="getdataForm">
<input TYPE="submit" NAME="getXLSbutton" VALUE="Get values"
onclick="getxlspagevalues();">
</form>
</body>
</html>
I open an Excel sheet with ActiveX from Inet Explorer 5+ with a form button.
I go to the Excel window and make a few changes.
Then I go back to the Explorer window and want to capture some cell
information from the Excel sheet.
But then I get an "ExcelApp is undefined" error.
Can someone give me some ideas on how to solve this?
here is the code:
<html>
<head>
<script language="JavaScript">
function openxlspage() {
ExcelApp = new ActiveXObject("Excel.Application");
ExcelApp.DisplayAlerts = false;
ExcelApp.Workbooks.Open("http://servername/path/mysheet.xls", 3, false);
ExcelApp.visible = true;
}
function getxlspagevalues() {
ExcelApp.Workbooks(1).SaveAs("C:\\TEST.XLS");
}
</script>
</head>
<body>
<form name="formName">
<input TYPE="submit" NAME="openXLSbutton" VALUE="Open XLS"
onclick="openxlspage();">
</form>
<form name="getdataForm">
<input TYPE="submit" NAME="getXLSbutton" VALUE="Get values"
onclick="getxlspagevalues();">
</form>
</body>
</html>