Support for German Locale in Named Range Formulae
English formulae are written into named region. This Excel file can be opened in an environment where the system is configured to German Locale however the English formula shall be translated to the German language. Following example demonstrates this feature, however, it requires Excel to be installed in German language and system locale shall be set to German as well.
Sample file for testing this feature can be downloaded from the following link:
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// Define variables | |
String name = "HasFormula"; | |
String value = "=GET.CELL(48, INDIRECT(\"ZS\",FALSE))"; | |
// Load the template file | |
Workbook wbSource = new Workbook(srcDir + "sampleNamedRangeTest.xlsm"); | |
// Get the worksheets collection | |
WorksheetCollection wsCol = wbSource.getWorksheets(); | |
// Add new name to the names collection | |
int nameIndex = wsCol.getNames().add(name); | |
// Set value to the named range | |
Name namedRange = wsCol.getNames().get(nameIndex); | |
namedRange.setRefersTo(value); | |
// Save the output file | |
wbSource.save(outDir + "sampleOutputNamedRangeTest.xlsm"); |