Class not registered error when creating Excel workbook in C#

前端 未结 8 870
梦毁少年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:17

    The registry hack described above fixed the same problem for me. The only difference was I had a 1.9 and a 1.7 entry. I deleted the 1.9 key and my problem was fixed.

    Other info:

    OS: Windows 10

    Visual Studio Professional 2015

    C# Windows Form Application

    This was on my work laptop. We have Office 2010 installed on each workstation.

    Some other things I tried that DID NOT WORK were the following:

    Repairing MS OFFICE

    Reinstalling MS OFFICE

    Downloading Microsoft Office 2010: Primary Interop Assemblies from Microsoft.

    I also had several versions of the Microsoft.Office.Interop.Excel.dll on my laptop. Deleting previous versions did not fix the problem.

    Glad I went to STACKOVERFLOW.COM because this place ROCKS!!!!!!

提交回复
热议问题