无法转换类型为' System .__ ComObject'的COM对象。接口类型' Microsoft.Office.Core.IRibbonUI'

时间:2015-12-04 11:01:49

标签: c# excel comaddin

嗨,我是excel addin的新手。我已经安装了microsoft office 2010,我的插件曾经很好地工作。为了在2013年进行验证我已经安装了2013并且正在运行版本2010和2013.最近我安装了2013,现在如果我打开2010版本我的插件加载但出现以下错误。请帮忙

错误

An exception was thrown with the folowing information: System.Runtime.CallbackException: A user callback threw an exception.  Check the exception stack and inner exception to determine the callback that failed. ---> System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.IRibbonUI'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000C03A7-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Core.IRibbonUI.InvalidateControl(String ControlID)
at myaddin.Wrappers.Office.Ribbon.Impl.Ribbon.InvalidateControl(String controlId) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Wrappers.Office\Ribbon\Impl\Ribbon.cs:line 37
at myaddin.Common.Ribbon.RibbonManager.InvalidateControl(String controlId) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Common\Ribbon\RibbonManager.cs:line 66
at myaddin.Common.Ribbon.RibbonManager.OnControlChanged(Object sender, ControlChangedEventArgs e) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Common\Ribbon\RibbonManager.cs:line 360
at myaddin.Wrappers.Office.Ribbon.ControlsProxy.RibbonControlsManager.OnControlChanged(Object sender, ControlChangedEventArgs e) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Wrappers.Office\Ribbon\ControlsProxy\RibbonControlsManager.cs:line 57
at myaddin.Wrappers.Office.Ribbon.ControlsProxy.ControlProxyBase.RaiseControlChanged() in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Wrappers.Office\Ribbon\ControlsProxy\ControlProxyBase.cs:line 110
at myaddin.Wrappers.Office.Ribbon.ControlsProxy.ControlProxyBase.set_IsEnabled(Boolean value) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Wrappers.Office\Ribbon\ControlsProxy\ControlProxyBase.cs:line 69
at myaddin.Wrappers.Office.Ribbon.ControlsProxy.ButtonControlProxy.set_IsEnabled(Boolean value) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Wrappers.Office\Ribbon\ControlsProxy\ButtonControlProxy.cs:line 34
at myaddin.Modules.Views.SupportView.UpdateControls() in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Modules\Views\SupportView.cs:line 115
at myaddin.Modules.Views.SupportView.AuthenticationStateEventHandler(Object sender, AuthenticationStateChangedEventArgs e) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Modules\Views\SupportView.cs:line 183
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at myaddin.Office.Service.Contract.ClientImpl.AuthenticationServiceClient.OnAuthenticationStateChanged(Object sender, AuthenticationStateChangedEventArgs e) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Office.Service.Contract\ClientImpl\AuthenticationServiceClient.cs:line 150
at myaddin.Office.Service.Contract.ClientImpl.AuthenticationServiceClient.OnOpened(Object sender, EventArgs e) in c:\iraddin\IR_Addin\myaddinOfficeLink\Main\src\myaddin.Office.Service.Contract\ClientImpl\AuthenticationServiceClient.cs:line 122
at System.ServiceModel.Channels.CommunicationObject.OnOpened()

0 个答案:

没有答案
相关问题