Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Problem with SWT OLE and Excel XML File
Problem with SWT OLE and Excel XML File [message #675535] Tue, 31 May 2011 15:11
GILLES  élios is currently offline GILLES éliosFriend
Messages: 7
Registered: March 2011
Junior Member
Hello guys, i'm trying to embed an Excel XML file in a SWT application but it doesn't work at all. It's okay when i do it with a Word XML file it's why it's weird ! I tried with Office 2007 and Office 2010 and the symptoms are the same.

Here my code :
package com.blabla;

import java.io.File;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.ole.win32.OLE;
import org.eclipse.swt.ole.win32.OleControlSite;
import org.eclipse.swt.ole.win32.OleFrame;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Main {

	public static void main(String[] args) {
		final Display display = Display.getDefault();
		final Shell shell = new Shell(display);
		shell.setSize(800, 600);
		shell.setLayout(new FillLayout());

		OleFrame oleFrame = new OleFrame(shell, SWT.NONE);

		OleControlSite oleControlSite = new OleControlSite(oleFrame, SWT.NONE,
				"Excel.Sheet", new File(
						"C:/Users/Blabla/Desktop/Excel.xml"));

		// OleControlSite oleControlSite = new OleControlSite(oleFrame,
		// SWT.NONE,
		// "Word.Document", new File(
		// "C:/Users/Blabla/Desktop/Word.xml"));

		oleControlSite.doVerb(OLE.OLEIVERB_SHOW);

		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}

}



If you know a better place to solve my problem, tell me Wink
Bye guys.
Previous Topic:Loading 32 bit IE from SWT browser widget on 64 bit machine
Next Topic:System Tray widget an the Unity Desktop
Goto Forum:
  


Current Time: Fri Apr 19 21:38:44 GMT 2024

Powered by FUDForum. Page generated in 0.02900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top