System.Runtime.InteropServices.COMException (0x80004005) RRS feed

  • Question

  • Excel 2007, VSTO 3.0, Visual Studio 2008

    I get this error occasionally when users double click on a save sheet created using the template and Add-In deployed with the solution.

    I have no idea about what happened to Sheet1 as indicated in the message and also cannot debug it.

    Any idea?


    Microsoft.VisualStudio.Tools.Applications.Runtime.ControlNotFoundException: This document might not function as expected because the following control is missing: Sheet1. Data that relies on this control will not be automatically displayed or updated, and other custom functionality will not be available. Contact your administrator or the author of this document for further assistance. ---> System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
       at Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IHostItemProvider.GetHostObject(String primaryType, String primaryCookie, IntPtr& hostObject)
       at Microsoft.VisualStudio.Tools.Office.Internal.HostItemProviderExtendedContractAdapter.GetHostObject(String objectType, String cookie)
       at Microsoft.Office.Tools.Excel.Adapter.ExcelHostItemProvider.GetWorksheet(String objectType, String cookie)
       at Microsoft.Office.Tools.Excel.Adapter.ExcelHostItemProvider.GetHostObject(String objectType, String cookie)
       at Microsoft.VisualStudio.Tools.Office.Internal.HostItemProviderExtendedContractAdapter.Microsoft.VisualStudio.Tools.Applications.Contract.IHostItemProviderContract2.GetHostObject(String objectType, String cookie)
       at Microsoft.VisualStudio.Tools.Office.Internal.IOfficeHostItemProviderProxy.GetHostObject(Type primaryType, String primaryCookie)
       at Microsoft.VisualStudio.Tools.Applications.Internal.IHostItemProviderProxy.Microsoft.VisualStudio.Tools.Applications.Runtime.IHostItemProvider.GetHostObject(Type primaryType, String primaryCookie)
       at Microsoft.VisualStudio.Tools.Office.RemoteComponent.GetHostItem[T](Type type, String cookie)
       at Microsoft.Office.Tools.Excel.Worksheet.GetObjects()
       --- End of inner exception stack trace ---
       at Microsoft.Office.Tools.Excel.Worksheet.GetObjects()
       at Microsoft.Office.Tools.Excel.Worksheet.get_Proxy()
       at Microsoft.Office.Tools.Excel.Worksheet.get_Controls()
       at Microsoft.Office.Tools.Excel.NamedRange.Init()
       at Microsoft.Office.Tools.Excel.NamedRange..ctor(IHostItemProviderExtended hostItemProvider, IServiceProvider serviceProvider, String cookie, Object container, String identifier)
       at eZ_Estimate.Sheet1.InitializeControls() in C:\Development\eZ-Estimate\eZ-Estimate\Sheet1.Designer.vb:line 173
       at eZ_Estimate.Sheet1.Initialize() in C:\Development\eZ-Estimate\eZ-Estimate\Sheet1.Designer.vb:line 58
       at Microsoft.VisualStudio.Tools.Office.EntryPointComponentBase.Microsoft.VisualStudio.Tools.Applications.Runtime.IEntryPoint.Initialize(IServiceProvider hostContext)
       at Microsoft.VisualStudio.Tools.Applications.AddInAdapter.ExecutePhase(ExecutionPhases executionPhases)
       at Microsoft.VisualStudio.Tools.Office.Internal.OfficeAddInAdapterBase.InitializeEntryPointsHelper()

    Thursday, April 18, 2013 10:33 AM

All replies

  • Hello,

    Thanks for your participation in this forum.

    According to your description, this issue is more related to Visual Studio Tools for Office. We will move this thread to VSTO forum for better support.

    Also, I am trying to involve some senior engineers into this issue for better troubleshooting. This will take some time. Your patience will be appreciated.


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 22, 2013 3:04 AM
  • I find the useful article which list below:

    Deploying your VSTO 2008 Add-In to All Users

    I hope this can help you. Thanks

    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Monday, April 22, 2013 10:10 AM