【发布时间】:2014-08-30 02:53:54
【问题描述】:
我设置了一个带有 OLE 框架的应用程序以进行就地编辑。 Word 文件一切正常,但保存 Excel 不起作用。 Excel 应用程序的保存按钮要么灰显(我猜是非 OLE Excel 仍处于打开状态时),要么如果它没有灰显,它会显示“刷新”(德语,但仍然如此)并且不保存。不会显示任何类型的错误消息。
OleControlSite#save(File, boolean) 有效,但我们无法向客户解释为什么他们无法点击 Excel 保存按钮,因此我们需要以某种方式对其进行修复。
重现问题的小演示:
public class OleDemoDialog extends Dialog {
public static void main(String[] args) {
OleDemoDialog dialog = new OleDemoDialog(new Shell());
dialog.open();
}
protected OleDemoDialog(Shell parentShell) {
super(parentShell);
setShellStyle(getShellStyle()| SWT.SHELL_TRIM);
}
@Override
protected Control createDialogArea(Composite parent) {
OleFrame oleFrame = new OleFrame(parent, SWT.CLIP_CHILDREN);
oleFrame.setBackground(JFaceColors.getBannerBackground(parent
.getDisplay()));
oleFrame.setLayoutData(new GridData(GridData.FILL_BOTH));
OleControlSite oleControlSite = new OleControlSite(oleFrame, SWT.NONE,
new File("Mappe1.xlsx"));
oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
return oleFrame;
}
@Override
protected Point getInitialSize() {
return new Point(600, 600);
}
}
【问题讨论】:
-
@HellBaby 我现在做了,但我没有看到提到我描述的错误。