Wednesday, June 27, 2012 11:50 PM
Seems like a simple question, but I cannot find a clear answer:
I have clients that run different versions of Windows. Some clients have Office 2007 and some have 2010. I have a .NET 3.5 solution developed with VS2010 and Office 2007. All is well.
I have another development machine which I would prefer to use, but it has Office 2010 installed. When I load the solution in VS, it forces me to upgrade it. If I go into the settings and uncheck the "always upgrade" button, then when I try to load it I get an error "One or more projects in the solution were not loaded correctly" with more detail "Cannot create the project because the application associated with this project type is not installed on this computer. You must install the Microsoft Office application that is associated with this project type."
If I allow the solution to upgrade, then when I build and try to install on a machine with Office 2007, I get an error:Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=18.104.22.168, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Office.Interop.Excel, Version=22.214.171.124, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
So, is it possible to build for Excel 2007, on a development machine with Office 2010 and VS 2010?
Thursday, June 28, 2012 5:16 AMModerator
Thanks for posting in the MSDN Forum.
It's based on my experience that you are able to do it if your solutions are application-level add-in. And you will not be able to develop document-level application for Office 2007 on the Office 2010 envirnment. And I don't recommand you do that. If you develop a Office 2007's add-in under 2010 envirnment, you might meet no problem at first. However Visual Studio 2010 will force you convert your solution to Office 2010's solution when you reopen your solution after you closed it.
Have a good day,
Tom Xu [MSFT]
MSDN Community Support | Feedback to us
Thursday, June 28, 2012 10:42 AM
Thank you Tom - of course mine is document-level add-in :(
But that does answer my question - so thanks.