0

This script works fine, but it keeps creating a new process in the task manager 'process' section. Not the Applications, just the Processes. I thought I was using the write 'quit' options but clearly not! This is the code:

<script>

function gbid(s)    {
return document.getElementById(s);
}

function GetData(cell,row){
var excel = new ActiveXObject("Excel.Application");
var excel_file = excel.Workbooks.Open("44227.xls");
var excel_sheet = excel.Worksheets("sheet1");

gbid('span1').innerText = excel_sheet.Cells(93,1).Value;    
gbid('span2').innerText = excel_sheet.Cells(95,3).Value;    
gbid('span3').innerText = excel_sheet.Cells(94,4).Value;    
gbid('span4').innerText = excel_sheet.Cells(95,4).Value;
gbid('span5').innerText = excel_sheet.Cells(95,5).Value;


gbid('span6').innerText = excel_sheet.Cells(97,1).Value;
gbid('span7').innerText = excel_sheet.Cells(99,3).Value;
gbid('span8').innerText = excel_sheet.Cells(98,4).Value;
gbid('span9').innerText = excel_sheet.Cells(99,4).Value;
gbid('span10').innerText = excel_sheet.Cells(99,5).Value;

excel_file.Close();
excel.Application.Quit();
excel.Close();
}
</script>
<body onload="GetData();" />

The rest is just tables and such so no biggie. No significant code or anything. As you can see I've tried three different types of lines, and I've even tried them by themselves. NADA! I've even tried them without the ';' at the end! I've searched this site and used those examples but IT JUST WONT WORK! It'll keep creating new processes! Is it because I used: new ActiveXObject("Excel.Application"); ?

2
  • Let me guess... excel.Quit(); ?! sob!!! Jul 11, 2013 at 2:17
  • According to msdn.microsoft.com/en-us/library/ie/7sw4ddf8%28v=vs.94%29.aspx supposedly it is ExcelSheet.Application.Quit();. Though that is created by 'new ActiveXObject("Excel.Sheet");`, not "Excel.Application". Perhaps there is an exception causing your JavaScript code to abort and never call the Quit() function?
    – dsh
    Jul 11, 2013 at 2:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.