We have existing VS 2008 VSTO add-ins for Word 2003 and Excel 2003. We are unable to upgrade the Office version at this time.
We have just tried to upgrade our solution to VS 2010 and it converts and compiles fine, but when building and running the add-in we receive a message saying that the required version of Office is not installed.
Is there any way of getting around this issue (without upgrading to Office 2007 or 2010) so that we can use VS 2010 to build this add-in?
No, unfortunately it's not possible. VSTO 2010 will not compile solutions designed for Office 2003. It is designed to work with with 2007/2010.
To create solutions for Office 2003 you'll need VSTO 2005 on VS2003 or VSTO 2005 SE / VSTO 2008 on VS2008 (in the case of the later, you can also develop for Office 2007).
No. The Office version is tied to the VSTO version which is tied to the Visual Studio version. Since VSTO 2010 does not support Office 2003, you cannot migrate.
Also, you need to be aware that opening a file extension may open the incorrect Office version. For example, on startup the later versions of Office will register themselves into the registry. If you are developing an Excel 2003 VSTO project, but you manually open an Excel 2007 workbook, then 2007 becomes the default. The next time you work on the Excel 2003 VSTO project, it will use Excel 2007. To get back to Excel 2003, you must run excel /regserver
.
- Description of the startup switches for Excel at http://support.microsoft.com/kb/291288.
There is a lot of inconvenience going around the answers.
First: Visual Studio 2010 can install its VSTO package even on machines where Office 2010 is not installed, for me it was done when upgrading VS2008/VSTO3 project.
Second: upgraded project retained links links to Office 11, Visual Studio 9 assemblies. (I honestly doubt this will pass with VS2012 though, if these assemblies aren't part of separate VSTO3.0/4.0 runtime packages).
Also, it is impossible to create Office 2003 project from VS2010, but https://stackoverflow.com/a/5325505/438039 points us to the wide possibilities of making VSTO4.0 (e.g. Interop for Office 12, Visual Studio 10) project to run within Office 2003. I think it's also possible to run it from Studio by changing project settings like in here: C# - can't debug office word add-in - this way, I recommend starting without debug (since external application isn't attached to debugger when starting..). This also revealed the existence of VSTOWord2003Adaptor.dll
which is loaded from VS2008 directory on my system. - hope it's a part of either VSTO3 / VSTO4 runtime packages. Another way is to edit .csproj, providing path to WinWord.exe - https://stackoverflow.com/a/12584772/438039 - both aren't working right.
It's harder to set up a proper VS2010/VSTO4 development environment than to build an addin targeting Office 2003.