PDA

View Full Version : Terminating Excel Process after starting ActiveX


yoinkster
02-22-2008, 12:58 PM
Hey guys, I'm using activeX on my local machine to edit some cells in an excel file and everything is working fine expect that the excel process is still lingering in taskman.

I've tried using

var Excel1 = new ActiveXObject("Excel.Application");
// my working code here
Excel1.Quit();

and

var Excel1 = new ActiveXObject("Excel.Application");
// my working code here
Excel1.Application.Quit();

The script executes fine and with both of those variations, IE doesn't whinge at an error, but the process still lingers until I leave the page. What am I doing wrong :/
*edit - I've tried it with visible being true and false, and when it's set to true, excel opens and closes itself fine, but the process lingers until I close the page*

*edit2 - Also, what's the command for saving the file with the same filename, whenever I edit the excel workbook with the script and tell it to save, it says that RANDOM.XLW already exists ... but I don't know what that file is!*

yoinkster
02-22-2008, 04:12 PM
Apparently this is an Excel bug and you need to use javas garbage collection method to clear it out, which I've now got working fine.
But I've still got a problem with saving the changes I make, any ideas?