I have developed this script where i write on an xls worksheet.
var excelFile = "C:\\TestActiveX\\Test.xls";
function readExcelFileAndUpdateView()
{
var w =new ActiveXObject("Excel.Application");
w.Workbooks.Open(excelFile);
var objWorksheet1 = w.Worksheets(1);
var name =objWorksheet1.Cells(1,2);
if(name==null){
name="";
}
var objWorksheet2 = w.Worksheets(2);
var surname = objWorksheet2.Cells(1,2);
if(surname==null){
surname="";
}
var str = "Name is :"+name+"<br/>Surname is :"+surname;
document.getElementById("txtAreaXLS").innerHTML=str;
w.Application.Quit();
w.Quit();
w = null;
}
The problem is that when this function finishes execution, I have 2 EXCELL objects running in my Windows Task Manager. Releasing resources at the end of my function doesn't seem to be working.
I have also tried objWorksheet1.close(true);
and w.Workbooks.Close(true);
and w.ActiveWorkbook.Close(true);
with no luck.
Does anyone have a clue which are the open Objects, and how can I get rid of them?