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 and then selecting Properties > Details and then editing the Language field. Please use BuiltInDocumentPropertyCollection.GetLanguage() property 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 screenshot that shows the modified Language field by 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();
}