Home > Enterprise >  Excel VSTO refuses to load on particular machine
Excel VSTO refuses to load on particular machine

Time:03-30

We have VSTO addin for Excel, and it is working on all system except one, I got following error from problem machine.

It seems that there is problem of loading this Excel extension, and there is no clue why this will happen on particular system. Error from problem machine is as follows,

System.Runtime.InteropServices.COMException (0x800A03EC): Cannot insert object.
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32\[\] aWrapperTypes, MessageData& msgData)
at Microsoft.Office.Interop.Excel.Shapes.AddOLEObject(Object ClassType, Object Filename, Object Link, Object DisplayAsIcon, Object IconFileName, Object IconIndex, Object IconLabel, Object Left, Object Top, Object Width, Object Height)
at Microsoft.Office.Tools.Excel.ControlCollectionImpl.CreateWrapperAndGetCookie(String name, Double left, Double top, Double width, Double height, Boolean anchor, \_OLEObject& outObject)
at Microsoft.Office.Tools.Excel.ControlCollectionImpl.InternalAddOtherControl(Control control, Double left, Double top, Double width, Double height, String name, Boolean anchor)
at Microsoft.Office.Tools.Excel.ControlCollectionImpl.AddControl(Control control, Range range, String name)
at TechnicalCalculation.Sheet1.LoadSchedulerUserControl()
at TechnicalCalculation.ThisWorkbook.InitializeService()
at TechnicalCalculation.ThisWorkbook.ThisWorkbook_Startup(Object sender, EventArgs e)
at Microsoft.Office.Tools.Excel.WorkbookImpl.OnStartup()
at Microsoft.Office.Tools.Excel.WorkbookImpl.WorkbookExtensionImpl.Microsoft.Office.Tools.EntryPoint.OnStartup()
at Microsoft.Office.Tools.Excel.WorkbookBase.OnStartup()
at TechnicalCalculation.ThisWorkbook.FinishInitialization()
at Microsoft.Office.Tools.Excel.WorkbookBase.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()

We have tried following,

  1. Try and fulfill any dependencies, which are fulfilled.
  2. VSTO is packaged in a setup file, we have uninstalled and reinstalled it.
  3. VSTO, it can emit logs, but logs are not emitted while loading VSTO is getting loaded. It seems that before any code execution from VSTO it is restricted to load with Excel.

CodePudding user response:

You can use the event viewer in Windows to see exception messages that are captured by the Visual Studio Tools for Office runtime when you install or uninstall Office solutions. You can use these messages from the event logger to resolve installation and deployment problems. Read more about that in the Event logging for Office solutions article.

The VSTO_SUPPRESSDISPLAYALERTS windows environment variable can be set for enabling detailed Outlook and VSTO (Visual Studio Tools for Office) error messages when loading VSTO add-ins. See How do I enable VSTO error / display alerts?.

CodePudding user response:

I found solution for my problem, it is given in following link Solution is given at last step, for my problem

  • Related