title: Excel API Error
body: <p>I am using a standardized tool to access the Excel API (software robot). However since upgrading to Office 2013, I am getting an error when I try to open a workbook. The error is this:</p>
  
  <blockquote>
    <p>Internal : Could not execute code stage because exception thrown by
    code stage: Old format or invalid type library. (Exception from
    HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))</p>
  </blockquote>
  
  <p>There is quite a lot of code, and I cannot say for sure which one is failing, but I think it is these 3 lines (edit I have confirmed that it is indeed these lines of code that is failing):</p>
  
  <pre><code>Dim wb as Object = GetInstance(handle).Workbooks.Open(filename)
  name = wb.Name
  wb.Activate()
  </code></pre>
  
  <p>I also tried adding some lines on CultureInfo (which didn't help):</p>
  
  <pre><code>Dim wb as Object = GetInstance(handle).Workbooks.Open(filename)
  Dim ci As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("en-US")
  
  wb.GetType().InvokeMember("Add", Reflection.BindingFlags.InvokeMethod, Nothing, wb, Nothing, ci)
  
  name = wb.Name
  wb.Activate()
  </code></pre>
  
  <p>I have researched the error (quite a lot) and found a lot of articles/posts suggestion some regional settings (<a href="https://support.microsoft.com/da-dk/kb/2643492" rel="nofollow">like this one from Microsoft</a>). I have checked that my Windows is set to English (US), which I also believe is the case for Excel. But I am not sure excactly how to check the language of Excel.</p>
  
  <p>P.S. Can anyone tell me if those 3 lines of code is VBA or VB.NET?</p>