title: Interop.Excel localization and Range.Formula vs Formulalocal
body: <p>I'm trying to generate excel file using Interop.Excel, but I have 2 localizations where I need to run my WPF application.</p>
  
  <p>de-DE and en-US</p>
  
  <p>For localization de-DE my program works fine(also DE MS Office are installed on my laptop), but when I try to run it on the en-US server then I have problems.</p>
  
  <p>Here is a snippet of source code:</p>
  
  <pre><code>cell = "K" + rowCounter;          
  Excel.Range ThisRange = xlWorkSheet.get_Range(cell, System.Type.Missing);
  string myFunction;           
  
  if (Thread.CurrentThread.CurrentUICulture.IetfLanguageTag == "de-DE")
     {
      myFunction = "=+WENN(I" + rowCounter + "&lt;=J" + rowCounter + ";J" + rowCounter + "-I" + rowCounter + ";\"24:00\"+(J" + rowCounter + "-I" + rowCounter + "))";
  
      ThisRange.FormulaLocal = myFunction;         
     }
  else
     {
      myFunction = "=+IF(I" + rowCounter + "&lt;=J" + rowCounter + ";J" + rowCounter + "-I" + rowCounter + ";\"24:00\"+(J" + rowCounter + "-I" + rowCounter + "))";
  
      ThisRange.Formula = myFunction;
     }
  </code></pre>
  
  <p>And I always get kind of this exception:</p>
  
  <p>Exception: System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp; msgData) at Microsoft.Office.Interop.Excel.Range.set_Formula(Object value)</p>
  
  <p>I also tried to change localization to de-DE when different localization is recognized - was not helpful.</p>
  
  <p>Do you know please what might be wrong?</p>
  
  <p>Thank you in advance.</p>