C++を使用したWorkbookの数式計算モードの設定

Contents
[ ]

Microsoft Excelでの式計算モードを設定するには:

  1. 、次に計算オプションを選択します。 1つのオプションを選択します。

Aspose.Cellsでは、Formula Calculation Modeを設定することもできます。 FormulaSettings.GetCalculationMode() モードプロパティを使用します。これに CalcModeType 列挙型を割り当てることができます。この列挙型には次のいずれかの値が含まれています:

  • CalcModeType::Automatic
  • CalcModeType::AutomaticExceptTable
  • CalcModeType::Manual
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

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

    // Source directory path
    U16String srcDir(u"..\\Data\\01_SourceDirectory\\");

    // Output directory path
    U16String outDir(u"..\\Data\\02_OutputDirectory\\");

    // Path of output excel file
    U16String outputFilePath = outDir + u"output_out.xlsx";

    // Create a workbook
    Workbook workbook;

    // Set the Formula Calculation Mode to Manual
    workbook.GetSettings().GetFormulaSettings().SetCalculationMode(CalcModeType::Manual);

    // Save the workbook
    workbook.Save(outputFilePath, SaveFormat::Xlsx);

    std::cout << "Workbook saved successfully with manual calculation mode!" << std::endl;

    Aspose::Cells::Cleanup();
}