Specify the Language of the Excel File using BuiltIn Document Properties with C++

Possible Usage Scenarios

You can change the language of an Excel file by right‑clicking the file, selecting Properties > Details, and editing the Language field. Please use the BuiltInDocumentPropertyCollection::SetLanguage() method to change it programmatically using Aspose.Cells APIs.

Specify the Language of the Excel File using BuiltIn Document Properties

The following sample code creates a workbook and changes its built‑in document property named Language. Please see the output Excel file generated by the code and a screenshot that shows the modified Language field by the BuiltInDocumentPropertyCollection::GetLanguage() property.

todo:image_alt_text

Sample Code

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

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

    // Create workbook object
    Workbook wb;

    // Access built-in document property collection
    BuiltInDocumentPropertyCollection bdpc = wb.GetBuiltInDocumentProperties();

    // Set the language of the Excel file
    bdpc.SetLanguage(u"German, French");

    // Save the workbook in xlsx format
    wb.Save(u"..\\Data\\02_OutputDirectory\\outputSpecifyLanguageOfExcelFileUsingBuiltInDocumentProperties.xlsx", SaveFormat::Xlsx);

    std::cout << "Language set successfully!" << std::endl;

    Aspose::Cells::Cleanup();
}