I have an Excel File on a German System which contains the following formula:
=TEXT(Durchführungsdatum; “TT.MM.JJJJ”)
I open this file with Aspose.Cells and execute workbook.CalculateFormula();
The formula works perfectly well on my machine.
However, when I execute the same code with the same excel file on a different machine with different language settings, some parts of the format string are not recognized. I Suppose this is because the format string is language dependent and the format TT works only on a German machine.
My Question: How can I make sure that my excel file works on every machine, no matter what language setting this machine has? My experiments have shown that Excel can handle the different formats, so how can we?
You simply cannot enter a formula like =IF(C5=0,42,C3/C4) into a german Excel. Excel marks this an invalid. You have to use =WENN(C5=0;42;C3/C4).
furthermore, the formula tokens are translated perfectly well when moving between differen machines with different language settings. Only the Format string causes problems.
I think you may try to specify locale/regional settings when loading the workbook or after loading the file for your different locales on different machines accordingly, see the sample code segment for your reference:
e.g Sample code:
Good to know that your issue is sorted out by the suggested code. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.