Specify the Language of the Excel File using BuiltIn Document Properties with JavaScript via C++
Contents
[
Hide
]
Possible Usage Scenarios
You can change the language of an Excel file by right‑clicking the file, then selecting Properties > Details, and editing the Language field. Please use the BuiltInDocumentPropertyCollection.language property to change it programmatically using Aspose.Cells for JavaScript via C++ 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 the screenshot that shows the modified Language field using the BuiltInDocumentPropertyCollection.language property.

Sample Code
<!DOCTYPE html>
<html>
<head>
<title>Aspose.Cells Example</title>
</head>
<body>
<h1>Specify Language Using BuiltInDocumentProperties</h1>
<input type="file" id="fileInput" accept=".xls,.xlsx,.csv" />
<button id="runExample">Run Example</button>
<a id="downloadLink" style="display: none;">Download Result</a>
<div id="result"></div>
</body>
<script src="aspose.cells.js.min.js"></script>
<script type="text/javascript">
const { Workbook, SaveFormat } = AsposeCells;
AsposeCells.onReady({
license: "/lic/aspose.cells.enc",
fontPath: "/fonts/",
fontList: [
"arial.ttf",
"NotoSansSC-Regular.ttf"
]
}).then(() => {
console.log("Aspose.Cells initialized");
});
document.getElementById('runExample').addEventListener('click', () => {
// Create a workbook object.
const wb = new Workbook();
// Access the built‑in document property collection.
const bdpc = wb.builtInDocumentProperties;
// Set the language of the Excel file.
bdpc.language = "German, French";
// Save the workbook in XLSX format.
const outputData = wb.save(SaveFormat.Xlsx);
const blob = new Blob([outputData]);
const downloadLink = document.getElementById('downloadLink');
downloadLink.href = URL.createObjectURL(blob);
downloadLink.download = 'outputSpecifyLanguageOfExcelFileUsingBuiltInDocumentProperties.xlsx';
downloadLink.style.display = 'block';
downloadLink.textContent = 'Download Excel File';
document.getElementById('result').innerHTML = '<p style="color: green;">Language set successfully! Click the download link to get the file.</p>';
});
</script>
</html>