2016-12-05 1 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

동일한 오류 Flavio. 여전히 스레드 "main"에 예외가 있습니다. org.eclipse.swt.SWTException : 클래스 ID가 레지스트리에 없습니다. – user2307786

+0

프로그램을 실행중인 시스템에 Excel이 설치되어 있습니까? –

+0

LibreOffice flavio가 있습니다. 문제가 될 수 있습니까? 심지어 내가 그것에 대해 생각하고 있었는데, Microsoft Office를 설치하면이 오류를 막을 수 있습니까? – user2307786