首页 > 解决方案 > Ole Frame在Linux环境下无法打开excel文件

问题描述

我设置了一个带有 OLE 框架的应用程序 (RCP) 用于就地编辑。OleFrame 无法在 linux(CentOS7) 环境中打开 excel 文件。我使用的是Apache OpenOffice 4.1.2。

private void createExcelPart(Shell shell) 
{ 
    //OleFrame is actually a Composite for placing OLE controls 
    OleFrame oleFrame = new OleFrame(shell,SWT.NONE); 

    //OleClientSite provides a place to embed an OLE object into a container, where the OLE object represented by "Excel.Sheet" is Excel. 
    OleClientSite clientSite = new OleClientSite(oleFrame,SWT.NONE,"Excel.Sheet"); 

    setValueForA1Cell(clientSite); 

    //OleClientSite action when displaying OLE object, the action here is OLEIVERB_SHOW, display 
    clientSite.doVerb(OLE.OLEIVERB_SHOW); 
} 

目标环境:

BootLoader 常量:OS=linux, ARCH=x86_64, WS=gtk, NL=en_US 命令行参数:-os linux -ws gtk -arch x86_64

MESSAGE 应用程序错误

java.lang.Error: Unresolved compilation problems: 
The import org.eclipse.swt.ole cannot be resolved

OleFrame cannot be resolved to a type
OleClientSite cannot be resolved to a type
OLE cannot be resolved to a variable

请给我任何解决方案。谢谢

标签: javalinuxapache-poieclipse-rcpole

解决方案


推荐阅读