Inaktivera kompatibilitetskoll i Excel med C++

Inaktivera kompatibilitetskoll i Excel-arbetsblad i C++

Hur man inaktiverar kompatibilitetskontrollen med hjälp av Microsoft Excel

För att inaktivera kompatibilitetskontrollen i Microsoft Excel (t.ex. Microsoft Excel 2007/2010):

  • (Excel 2007) Klicka på Office-knappen, klicka på Förbered, klicka på Kör kompatibilitetskontroll, och avmarkera sedan alternativet Kontrollera kompatibilitet när du sparar arbetsboken.
  • (Excel 2010) På fliken Fil klickar du på Info, sedan Sök efter problem, klickar på Kontrollera kompatibilitet och avmarkerar till sist alternativet Kontrollera kompatibilitet när du sparar den här arbetsboken.

Hur man inaktiverar kompatibilitetskontrollen med hjälp av Aspose.Cells API:er

Ställ in egenskapen Workbook.GetCheckCompatibility() till False för att inaktivera Microsoft Excels kompatibilitetskontroll.

Kodexempel

Följande kodexempel visar hur man inaktiverar kompatibilitetskoll med 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;
}