Disable Compatibility Checker in Excel with C++

Disable Compatibility Checker in Excel Worksheets in C++

How to Disable Compatibility Checker using Microsoft Excel

To disable the Compatibility Checker in Microsoft Excel (for example Microsoft Excel 2007/2010):

  • (Excel 2007) On the Office button, click Prepare, then Run Compatibility Checker, and then clear the Check compatibility when you save this workbook option.
  • (Excel 2010) On the File tab, click Info, then Check for issues, click Check Compatibility, and, finally, clear the Check compatibility when you save this workbook option.

How to Disable Compatibility Checker using Aspose.Cells APIs

Set the Workbook.GetCheckCompatibility() property to False to disable Microsoft Excel’s Compatibility Checker.

Code Examples

The code examples that follow show how to disable the Compatibility Checker with Aspose.Cells for C++.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C

    // Path to the documents directory.
    U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
    
    // Open a template file
    U16String templateFilePath = srcDir + u"sample.xlsx";
    Workbook workbook(templateFilePath);

    // Disable the compatibility checker
    workbook.GetSettings().SetCheckCompatibility(false);

    // Path to save the output file
    U16String outputFilePath = srcDir + u"Output_BK_CompCheck.out.xlsx";

    // Saving the Excel file
    workbook.Save(outputFilePath);

    std::cout << "Excel file saved successfully!" << std::endl;

    Aspose::Cells::Cleanup();
    return 0;
}