2016-12-05 8 views
1

私はSWTのOleClientでEXCELファイルを表示したい場合は、私はエラーを以下の取得:レジストリで見つかっていないクライアントID - OLEオープンXSLXドキュメントエラー

final Shell shell = new Shell(display); 
shell.setLayout(new FillLayout()); 
File openFile = new File("D:\\eDefterKutuphanesi\\eDefter\\excel.xlsx"); 
OleFrame frame = new OleFrame(shell, SWT.NONE); 
OleClientSite site2 = new OleClientSite(frame,SWT.NONE,"D:\\test.xlsx"); 

エラーメッセージ:

Exception in thread "main" org.eclipse.swt.SWTException: Class ID not found in registry 
    at org.eclipse.swt.ole.win32.OLE.error(OLE.java:317) 
    at org.eclipse.swt.ole.win32.OLE.error(OLE.java:283) 
    at org.eclipse.swt.ole.win32.OleClientSite.<init>(OleClientSite.java:226) 
    at infina.accounting.reports.views.ExcelDonusturView.main(ExcelDonusturView.java:438) 

答えて

0

てみてくださいこれは

final Shell shell = new Shell(display); 
shell.setLayout(new FillLayout()); 
OleFrame frame = new OleFrame(shell, SWT.NONE); 
OleClientSite site = new OleClientSite(frame, SWT.NONE, "Excel.Sheet", new File("D:\\test.xlsx")); 

をにする必要があります。は、Excelの場合は"Excel.Sheet"です。

また、マシンにMicrosoft Excelがインストールされていることを確認してください。
Class ID not found in registryは、必要なアプリケーションが見つからないことを示しています。

+0

同じエラーです。それでもスレッド "main"の例外が表示されます。org.eclipse.swt.SWTException:クラスIDがレジストリに見つかりません – user2307786

+0

プログラムを実行しているマシンにExcelがインストールされていますか? –

+0

私はLibreOffice flavioを持っています。これは問題になりますか?私もそれについて考えていましたが、Microsoft Officeをインストールするとこのエラーを防ぐことができますか? – user2307786

関連する問題