Community
Participate
Working Groups
Build Identifier: 3.6 Excel and other OLE components allow to be connected to, rather than creating a new instance. The OleAutomation API does not allow to specify whether we should try to connect to an existing instance. For example, there could be such constructor: new OleAutomation(String progId, boolean connectToExisting); if(connectToExisting) { // Native call currently missing from SWT definitions COM.GetActiveObject(appClsid, NULL, ppvObject) } else { COM.CoCreateInstance(appClsid, 0, COM.CLSCTX_LOCAL_SERVER | COM.CLSCTX_INPROC_SERVER, COM.IIDIUnknown, ppvObject); } Such a feature is important when piloting Excel and such APIs because we don't want to create a new instance. A work around for Excel seems to work, but it is not enough because if an instance cannot be found it will create one rather than throwing an Exception that can be caught and acted upon. This workaround is: // Note: the next line works with patch from bug 318942 OleAutomation sheet = new OleAutomation("Excel.Sheet"); OleAutomation application = sheet.getProperty(sheet.getIDsOfNames(new String[] {"Application"})[0]).getAutomation(); Reproducible: Always Steps to Reproduce: new OleAutomation("Excel.Application", true)
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.