Class not registered error when creating Excel workbook in C#

前端 未结 8 857
梦毁少年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!!!!!!

    0 讨论(0)
  • 2021-02-02 08:17

    We had the same problem.

    Our setup is like this :
    Office 2010 : Word and Excel but Office 2013 : Outlook

    We ran the installation program for Office 2010 and choose the repair option. After that, all the wrong keys in the registry for Word and Excel were deleted and the problem was solved.

    0 讨论(0)
提交回复
热议问题