lingering excel process
Amardeep Singh <[email protected]>
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Consider the following piece of code:
public class testexcel
{
public static void main(String[] args) throws COMException
{
try
{
Ole32.CoInitialize();
DispatchPtr app = new DispatchPtr("Excel.Application");
app.put("Visible", false);
DispatchPtr wbooks = (DispatchPtr) app.get("Workbooks");
DispatchPtr wbook = (DispatchPtr) wbooks.invoke("Open",
"c:\\t.xls");
wbook.invoke("Close");
wbooks.invoke("Close");
app.invoke("Quit");
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
Ole32.CoUninitialize();
}
}
}
When i run the above, excel process still keeps on running even though
the above program is finished. What do we need to do to get rid of
this process.
Thanks