Why are there two design time adaptors loading in Excel 2007
So, while running Excel 2007 with VSTO installed, you may have noticed that there are two design time adaptors registered, one for Excel 2003 and one for Excel 2007:
I asked one of our engineers, Richard Cook, to give me a run down of why we do this. I think it is interesting from an engineering tradeoffs perspective.
This has always been the case since we started supported both Office 2003 and Office 2007 in Visual Studio 2008. The VSTO design time installs a design-time adaptor for both Excel 2003 and 2007. Since both versions of Excel share the same add-in registry (HKLM\SOFTWARE\Microsoft\Office\Excel etc.) both adaptors appear in the list of add-ins for both versions of Excel. Due to divergences in behaviour it was not possible to make a single design-time adaptor support both versions of the host applications in a reasonable amount of time.
I determined that there were four options for implementing design-time support for multiple versions of Office:
1) Implement separate design-time adaptors, one per version of Office
Pros: Easy to implement - just make sure the adaptors register COM co-classes with distinct GUIDs.
Cons: Both adaptors for both versions appear in the list of installed add-ins for each version of the host.
2) Unify the design-time adaptors into a single entity
Pros: A single adaptor. Clean in terms of impact on file system, registry and setup.
Cons: Merging divergent code paths is tricky and error-prone.
3) Selectively install only one or the other depending on the versions of Office installed on the target machine
Pros: Only one adaptor on machine at a time.
Cons: Significantly more complex setup logic. How do we deal with end users upgrading from one version of Office to the next?
4) Implement a proxy to delegate to the appropriate design-time adaptor while only having to register a single entry in the host application's registry (I call this the "vstoee-for-design-time" approach
Pros: Allows divergent codebases in adaptors without cluttering add-in registry with registrations for multiple design-time adaptors.
Cons: Have to implement the proxy. Need time. More time.
So basically, we do this because it was the cheapest and least risky approach. Kind of a classic engineering tradeoff problem.
If you're worried about having two design-time adaptors loaded into your version of Excel (the main impact might be a little additional memory use for no gain), you can uncheck the Excel 2003 adaptor (for Excel 2007) or the Excel 2007 adaptor (For Excel 2003) from the COM Add-ins dialog without any ill-effect.