Formula Language ExcelApplication MSOfficeAutomation

hello,
did someone know how to change the formula language.
i used an example wich contains =Sum
but my excel installation expect =Summe in german^^
i want use english as neutral language.

Var excel As New ExcelApplication

Var book As ExcelWorkbook
Var sheet As ExcelWorksheet

excel.Visible = True
book = excel.Workbooks.Add
excel.ActiveSheet.Name = "Test Report"
For i As Integer = 0 To ProduceList.ListCount - 1
  excel.Range("A" + Str(i + 1), "A" + Str(i + 1)).Value = ProduceList.Cell(i, 0)
  excel.Range("B" + Str(i + 1), "B" + Str(i + 1)).Value = ProduceList.Cell(i, 1)
Next
excel.Range("A" + Str(ProduceList.ListCount + 1), "A"+ Str(ProduceList.ListCount + 1)).Value = "Total"
excel.Range("B" + Str(ProduceList.ListCount + 1), "B"+ Str(ProduceList.ListCount + 1)).Value = "=SUM(B1:B" + Str(ProduceList.ListCount) + ")"
'excel.Range("B" + Str(ProduceList.ListCount + 1), "B"+ Str(ProduceList.ListCount + 1)).Value = "=SUMME(B1:B" + Str(ProduceList.ListCount) + ")"

Exception err As OLEException
  MessageBox(err.Message)

From what I understand, because you are interacting with Excel in a local language, you can’t send the command in English and that should be in the local language.

I guess this is different if you are using Plugins to create an Excel file that the user will open in a localized version. From what I read, Excel stores the names in English and do the translation when the file is opened/saved to show the local language to the user.

i found a excel.LanguageSettings property
maybe here i can switch the language settings.

i found in web

https://docs.microsoft.com/de-de/office/vba/api/office.msoapplanguageid
msoLanguageIDExeMode 4 Execution mode language.
msoLanguageIDInstall 1 Install language.
msoLanguageIDUI 2 User interface language.
msoLanguageIDUIPrevious 5 User interface language used prior to the current user interface language.

https://docs.microsoft.com/de-de/office/vba/api/office.msolanguageid
msoLanguageIDEnglishUK 2057 The English UK language
msoLanguageIDEnglishUS 1033 The English US language

1 Like

as workaround i set the language here, i had also installed a language display pack. setuplanguagepack.x64.en-us_.exe

1 Like