If you automate Microsoft Excel with Microsoft Visual Basic .NET, Microsoft Visual C# .NET, or Microsoft Visual C++, you may receive the following error when calling certain methods:

Error: 0x80028018 (-2147647512)
Description: Old Format or Invalid Type Library

COMException was unhandled:Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))

COMException was unhandled:Old format or invalid type library

To work around this problem, you can use one of the following methods:

  • Install the Multilingual User Interface Pack for yourversion of Office.
  • Or, set the CultureInfo prior to calling the Excel method. For example:
    代码
    System.Globalization.CultureInfo CurrentCI = System.Threading.Thread.CurrentThread.CurrentCulture;
    System.Threading.Thread.CurrentThread.CurrentCulture
    = new System.Globalization.CultureInfo("en-US");

     

相关文章:

  • 2021-06-22
  • 2021-10-13
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
猜你喜欢
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-04-10
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案