80040154类未注册(HRESULT异常:0x80040154(REGDB_E_CLASSNOTREG))n使用VBA.Collections

时间:2017-05-29 05:07:18

标签: c# vba dll vb6

我正在使用VBA的集合类。我在我的项目中导入了interop.VBA.dll。这是截图:

enter image description here

但是当我想运行该项目时,我收到以下错误:

System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {A4C4671C-499F-101B-BB78-00AA00383CBB} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

详细信息堆栈跟踪:

[COMException (0x80040154): Retrieving the COM class factory for component with CLSID {A4C4671C-499F-101B-BB78-00AA00383CBB} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).]
   _Default.Page_Load(Object sender, EventArgs e) in f:\ASP.NET Projects\SimpleWebPage\Default.aspx.cs:20
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2952

我已经检查过vba.dll是32位。我的电脑是64位。所以我把dll保存到Syswow64文件夹并用regasm.exe注册。注册dll的命令如下:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe VBA.dll

但我仍然得到这个错误。

System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {A4C4671C-499F-101B-BB78-00AA00383CBB} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

我收到错误的行是:        VBA.Collection agentCollection = new VBA.Collection(); 我该如何解决此错误。任何的想法 ?

0 个答案:

没有答案
相关问题