在应用程序的主要部分中,我称这一行为:
Excel.Application ExcelApp = new Excel.Application();它给了我一个例外:
System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'我尝试在x86中运行调试,x64模式是相同的结果。

发布于 2019-04-03 19:34:21
试着这样宣布他们,完全合格:
Microsoft.Office.Interop.Excel.Application xlapp =新的Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Application xlApp;
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;https://stackoverflow.com/questions/55502420
复制相似问题