Simple Document Level AddIn results in COMException (Office 2016 C2R 16.0.17531.20120).
A simple Document Level AddIn results in COMException.
The code below results in COMException with 16.0.17531.20120(2024/4/29) or newer version.
But it works fine with 16.0.17425.20176(2024/4/9) or older version.
When I activate 16.0.17531.20120 with Microsoft 365 account, the code works fine.The COMException seems to depends on Office Activation Methods. Activated using Office2016-product-code results in failure, Activated using Microsoft 365 results in success.
I can’t believe that such a quite simple code could fail !!
However, I tried it on several other PCs and it still failed.
Could anybody help me?
Thanks in advance!!
## Code
private void ThisDocument_Startup(object sender, System.EventArgs e)
{
this.ActionsPane.Clear();
}
## StackTrace
System.Runtime.InteropServices.COMException: ‘Exception from HRESULT :0x800A17D9’
at Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IActionsPaneSite.SetClient(IntPtr control)
at Microsoft.Office.Tools.ActionsPaneInternal.HookupSmartPane()
at Microsoft.Office.Tools.DockableControlCollection.Add(Control value)
at WordDocument1.ThisDocument.ThisDocument_Startup(Object sender, EventArgs e) at D:WordDocument1WordDocument1ThisDocument.cs:line 24
at Microsoft.Office.Tools.Word.DocumentImpl.OnStartup()
at Microsoft.Office.Tools.Word.DocumentImpl.DocumentExtensionImpl.Microsoft.Office.Tools.EntryPoint.OnStartup()
at Microsoft.Office.Tools.Word.DocumentBase.OnStartup()
at WordDocument1.ThisDocument.FinishInitialization() at D:WordDocument1WordDocument1ThisDocument.Designer.cs:line 57
at Microsoft.Office.Tools.Word.DocumentBase.Microsoft.Office.Tools.EntryPoint.FinishInitialization()
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.ExecutePhase(ExecutionPhases executionPhases)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.ExecuteEntryPoints()
A simple Document Level AddIn results in COMException. The code below results in COMException with 16.0.17531.20120(2024/4/29) or newer version.But it works fine with 16.0.17425.20176(2024/4/9) or older version.When I activate 16.0.17531.20120 with Microsoft 365 account, the code works fine.The COMException seems to depends on Office Activation Methods. Activated using Office2016-product-code results in failure, Activated using Microsoft 365 results in success. I can’t believe that such a quite simple code could fail !!However, I tried it on several other PCs and it still failed. Could anybody help me?Thanks in advance!! ## Codeprivate void ThisDocument_Startup(object sender, System.EventArgs e){ this.ActionsPane.Clear();} ## StackTraceSystem.Runtime.InteropServices.COMException: ‘Exception from HRESULT :0x800A17D9’at Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IActionsPaneSite.SetClient(IntPtr control)at Microsoft.Office.Tools.ActionsPaneInternal.HookupSmartPane()at Microsoft.Office.Tools.DockableControlCollection.Add(Control value)at WordDocument1.ThisDocument.ThisDocument_Startup(Object sender, EventArgs e) at D:WordDocument1WordDocument1ThisDocument.cs:line 24at Microsoft.Office.Tools.Word.DocumentImpl.OnStartup()at Microsoft.Office.Tools.Word.DocumentImpl.DocumentExtensionImpl.Microsoft.Office.Tools.EntryPoint.OnStartup()at Microsoft.Office.Tools.Word.DocumentBase.OnStartup()at WordDocument1.ThisDocument.FinishInitialization() at D:WordDocument1WordDocument1ThisDocument.Designer.cs:line 57at Microsoft.Office.Tools.Word.DocumentBase.Microsoft.Office.Tools.EntryPoint.FinishInitialization()at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.ExecutePhase(ExecutionPhases executionPhases)at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.ExecuteEntryPoints() Read More