C++を使ってExcelでの互換性チェッカーを無効にする

C++でExcelシート内の互換性チェッカーを無効にする

Microsoft Excelを使用して互換性チェッカーを無効にする方法

Microsoft Excel(例: Microsoft Excel 2007/2010)で互換性チェッカーを無効にする場合:

  • (Excel 2007)[Office] ボタンをクリックし、「準備」、[互換性の確認] をクリックし、「このブックを保存するときに互換性を確認する」オプションをクリアします.
  • (Excel 2010) ファイルタブをクリックし情報問題の確認互換性を確認をクリックし、最後にこのブックを保存する場合に互換性をチェックのチェックを外します。

Aspose.Cells APIを使用して互換性チェッカーを無効にする方法

Microsoft Excelの互換性チェッカーを無効にするには、Workbook.GetCheckCompatibility()プロパティをFalseに設定します。

コード例

以下のコード例は、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;
}