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?