COM Plug-in for Eclipse
September 09, 2010, 12:45:54 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Poll
Question: Any hints?
1 - 0 (0%)
2 - 0 (0%)
Total Voters: 0

Pages: [1]
  Print  
Author Topic: Excel not closed when closing editor  (Read 928 times)
agfeller
Newbie
*
Posts: 1


View Profile Email
« on: October 19, 2009, 08:51:47 PM »

Dear all,

I've created the wrapper classes for Excel.  

I'm initializing my editor like this:

WorksheetComposite  wsComp = new WorksheetComposite(parent, SWT.NONE, templateFile);
wsComp.setLayoutData(createLayoutData());

wsComp.getOleFrame().setContainerMenus(parent.getShell().getMenuBar().getItems());
wsComp.oleInplaceActivate();

application = wsComp.getWorksheetAutomation().getApplication();
appEventListener = new FeeTemplateEditor.AppEventListener();
application.addAppEventsListener(appEventListener);

My dispose method looks like this:

@Override
    public void dispose() {
        try {
            application.removeAppEventsListener(appEventListener);
        } catch (NullPointerException e) {
            // ignore
        }

        wsComp.getWorksheetAutomation().dispose();
        wsComp.getOleClientSite().dispose();
        excelSupport = null;

        super.dispose();
    }


Closing the editor or even the application will not release (dispose) the Excel process.
Are the any ideas or hints how to proceed to fix this?

Thanks a lot,
Alex

P.S. By the way, I'm using Eclipse 3.5.1

Logged
Mark Richter
Global Moderator
Full Member
*****
Posts: 137


View Profile
« Reply #1 on: October 20, 2009, 06:36:15 AM »

Hi Alex,

It appears that some other object references are still being held and therefore Excel is not exiting.  Have you tried forcing a Garbage Collection?

-Mark
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!