Class not registered error when creating Excel workbook in C#

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

    I had exactly the same issue. If you have installed a new version of Office and for some reason you have to install the older version without removing the new one (For my case I just need to install the Office XP Photo Editor) and this caused the issue.

    After spending 3 hours up and down, the best way is to repair the new version of Office and everything was back to normal as it should be.

    Hope this info helps provided you have the same or similar scenario.

提交回复
热议问题