Failed to open both Excel document and SWT application with Win32OLE embedded objects same time. [message #1781105] |
Thu, 01 February 2018 13:07 |
|
Hi Team,
I am having issue with Win32OLE opening Excel documents with embedded objects over Windows 64 bits. I can open both SWT application with OLE embedded object and Excel documents separately for review my each updates in the sheet.
However, I am not able to open both Excell documents and SWT application with OLE object in Windows 64 bits.
I am using the following environment :
1. JDK : jdk1.8.0_91 64-Bit
2. OS : Windows 7 Professional 64-Bit
3. Service Pack 1
3. JAR : jre1.8.0_91 64-Bit
4. Microsoft Office 2016 64-Bit
Here is my code :
-------------------------------------------------------------------------------------------
OleClientSite clientSite ;
try {
clientSite = new OleClientSite(frame, SWT.NONE, new File(filelocation));
} catch (SWTException e) {
e.printStackTrace();
disposeClient();
}
if (clientSite != null){
clientSite.doVerb(OLE.OLEIVERB_SHOW); // Show property use
hideToolbars(clientSite);
}
//Hide Toolbar and menubar
public static void hideToolbars(OleClientSite site) {
int result = site.queryStatus(OLE.OLECMDID_HIDETOOLBARS);
if ((result & OLE.OLECMDF_SUPPORTED) == OLE.OLECMDF_SUPPORTED) {
site.exec(OLE.OLECMDID_HIDETOOLBARS, OLE.OLECMDEXECOPT_DODEFAULT, new Variant(), new Variant());
}
}
// Dispose object
void disposeClient() {
if (clientSite != null)
clientSite.dispose();
clientSite = null;
}
Thanks
Lalit
Lalit
[Updated on: Fri, 02 February 2018 07:07] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02150 seconds