0

We distribute an Excel customization as code behind an xlsm document. Previously, our build server had Office 2007 installed and we built the xlsm using the Office 2007 Primary Interop Assemblies (and added them as install prerequisites).

Recently, we upgraded the build server to Office 2013 and started building the xlsm using Microsoft Visual Studio 2010 Tools for Office Runtime (and added them as install prerequisites).

The problem: users who previously saved changes to the old xlsm file (built using Office2007PIA) cannot open their old files once the new version of the customization is installed on their machine. They get the following exception:

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80070490): Element not found. (Exception from HRESULT: 0x80070490)
at Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IHostItemProvider.GetHostExtender(String extenderType, String extenderCookie, IntPtr& extenderObject)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.Office.Tools.IHostItemProvider.GetHostExtender(Type primaryType, String primaryCookie)
at Microsoft.Office.Tools.Excel.ControlSiteImpl..ctor(IServiceProvider serviceProvider, IHostItemProvider hostItemProvider, String primaryCookie, String identifier, Object containerComponent, UInt32 officeVersion, Control control, _OLEObject extenderControl, Boolean isDynamic)
at Microsoft.Office.Tools.Excel.FactoryImpl.Microsoft.Office.Tools.Excel.Factory.CreateControlSite(IServiceProvider serviceProvider, IHostItemProvider hostItemProvider, String primaryCookie, String identifier, Object containerComponent, Control control)
at Microsoft.Office.Tools.Excel.Controls.Label..ctor(Factory factory, IHostItemProvider hostItemProvider, IServiceProvider serviceProvider, String cookie, String extenderCookie, Object container, String identifier)
at MyCustomization.Sheet1.InitializeControls()
at MyCustomization.Sheet1.Initialize()
at Microsoft.Office.Tools.Excel.WorksheetBase.Microsoft.Office.Tools.EntryPoint.Initialize()
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.LoadEntryPoints(IntPtr serviceProvider)

Question: how can we make the new build backwards compatible with xlsm files saved using the old build?

MattDG
  • 373
  • 3
  • 14
  • when you run this are you running it as `Administrator`..? just curious if that maybe causing your issue also does this have an `UnInstall / Fix` option if so can you try to select FIX when uninstalling – MethodMan Sep 11 '14 at 20:44
  • @DJKRAZE: it throws the same exception whether I run as admin or not. It does not have a Fix option. Thanks! – MattDG Sep 12 '14 at 16:19
  • did the fix option work at least.. can you qualify that part.? thanks – MethodMan Sep 12 '14 at 16:20
  • @DJKRAZE: it doesn't have a fix option and I don't know how to add one. I create the ClickOnce installer using Publish in VS. – MattDG Sep 12 '14 at 16:51

0 Answers0