Class not registered error when creating Excel workbook in C#

前端 未结 8 858
梦毁少年i
梦毁少年i 2021-02-02 07:35

When I try to access an Excel spreadsheet using the following code I get a \"Library not registered\' error when defining the workbook object wrkbuk using C# from Visual Studio

8条回答
  •  忘了有多久
    2021-02-02 08:03

    I will confirm @stuzor 's answer on two machines I've encountered.

    Background:

    Windows7 64 bit
    Office 2010 (32bit) 
    Lync 2013 
    

    HKEY_CLASSES_ROOT\TypeLib\ , searched for "Office.Interop.Excel". Found the barely existent "1.8" folder. Upon deletion, the function in an old VB.net app began working immediately.

提交回复
热议问题