Hi,
I’m using Aspose.Cells with C# to create and save a worksheet to an excel file. Sample code:
Console.WriteLine(“CurrentCulture is {0}.”, CultureInfo.CurrentCulture.Name); // ru-Ru
Workbook book = new Workbook();
WorksheetCollection worksheets = book.Worksheets;
Console.WriteLine(worksheets[0].Name);
I’ve tried to change language & region settings to non-english values, but I keep getting ‘Sheet1’ worksheet name instead of a localized one. The book settings have correct culture info.
Console.WriteLine(book.Settings.CultureInfo); // ru-Ru
I assumed Aspose will use the language settings of the OS, isn’t that correct?
@fedorcher,
You may try to use the following lines of code before saving the workbook:
book.Settings.Region = CountryCode.Russia;
book.Settings.LanguageCode = CountryCode.Russia;
However, language or regional settings would take affect for data formatting only in most cases. Generally, Aspose.Cells follows MS Excel (us english) standards/specifications when rendering spreadsheets. You may change or specify your desired name (in Russia) for the worksheet using Worksheet.Name attribute accordingly.
@Amjad_Sahi,
thanks for response.
As expected, setting region doesn’t affect the name.
Is it safe to assume, that Aspose does not consider the language packs, installed in Office components?
@fedorcher,
As suggested, you may change the worksheet name using Worksheet.Name property.