检索com类工厂的组件 [英] Retreive the com class factory for component
本文介绍了检索com类工厂的组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
其实我想在我的应用程序中使用c#
读取Excel工作表我添加了Microsoft.Office.Interop.Excel的参考资料;
我的代码是
Actually I want to read Excel sheet in my application using c#
I have add reference of Microsoft.Office.Interop.Excel;
My code is
using Microsoft.Office.Interop.Excel;
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
但是它给出了一个错误
检索具有CLSID {00024500-0000-0000-C000-的组件的COM类工厂000000000046}由于以下错误而失败:80070002
but it gives an error
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070002
推荐答案
可能缺少依赖项,例如,请参阅此堆栈溢出
问题:无法在C#中实例化COM组件 - 错误80070002 [ ^ ]。
Possibly a missing dependency, see, for instance, this Stack Overflow
question: "Can't instantiate COM component in C# - error 80070002"[^].
这篇关于检索com类工厂的组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文