在Excel中禁用兼容性检查程序

使用Microsoft Excel

要在Microsoft Excel中禁用兼容性检查程序(例如Microsoft Excel 2007/2010):

  • (Excel 2007)在办公按钮上,单击准备,然后单击运行兼容性检查,然后清除保存此工作簿时检查兼容性选项。
  • (Excel 2010和2013)在“文件”选项卡上,单击信息,然后单击检查问题,点击检查兼容性,最后清除保存此工作簿时检查兼容性选项。

使用Aspose.Cells API

WorkbookSettings.CheckComptiliblity属性设置为False以禁用Microsoft Excel的兼容性检查程序。

假设我们有一个模板XLS文件。当用户在MS Excel 2007/2010/2013中保存或重新保存它时,将显示兼容性检查程序的对话框,如下面的屏幕截图所示。

todo:image_alt_text

下面的代码展示如何使用Aspose.Cells for Java禁用兼容性检查器。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(DisableCompatibilityChecker.class);
// Open a template file
Workbook workbook = new Workbook(dataDir + "sample.xlsx");
// Disable the compatibility checker
workbook.getSettings().setCheckCompatibility(false);
// Saving the Excel file
workbook.save(dataDir + "outCompCheck.xls");