10

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?

Todd Main
  • 28,951
  • 11
  • 82
  • 146
Ben Robbins
  • 2,889
  • 2
  • 31
  • 32

3 Answers3

5

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).

Todd Main
  • 28,951
  • 11
  • 82
  • 146
  • What? I find that hard to believe. What documenation or reference can you provide to back this claim? – AMissico Jun 22 '10 at 04:34
  • Sorry to be the bearer of bad news here. http://msdn.microsoft.com/en-us/library/bb772080.aspx – Todd Main Jun 22 '10 at 05:26
  • @Otaku: There is no mention that VSTO 2010 will not install if Office 2003 is installed. Can you provide the location in the topic? I find this hard to believe because Office, VSTO Runtime, Visual Studio, and .NET all support side-by-side installation. – AMissico Jun 22 '10 at 06:44
  • @AMissico: VSTO will not install *at all* if Office 2007 or Office 2010 is not detected during VS2010 install (but you can add it later once you've installed one of those). This is true for no versions of Office, as well as if Office 2003 *is* installed, as well as OpenOffice, Ubuntu in a Virtual Machine, Notepad, Chess Titans or any other program. Go ahead and give it a try and check your error log. I know you're having a really hard time believing this, I don't know why, so it's best to verify it yourself. If you need to develop for Office 2003 and 2007, VS2008 is your platform. – Todd Main Jun 22 '10 at 07:44
  • 1
    @Otaku: Yes, I understand that VSTO 2010 will not install if Office 2007/2010 is not installed, but saying it won't install if Office 2003 is installed is not correct. Therefore, your answer is not correct. – AMissico Jun 22 '10 at 07:47
  • 1
    @Otaku: "If you need to develop for Office 2003 and 2007, VS2008 is your platform." **You are absolutely correct and this is the correct answer.** I think you should change your answer then I will up vote and Ben Robbins will get his answer. – AMissico Jun 22 '10 at 07:49
  • @AMissico: The answer needs to stand, but I'm happy to augment. It's true that VSTO 2010 won't install if Office 2003 is installed. Office 2007/2010 cannot run side-by-side with Office 2003, so you'll have one or the other. If you have the former, VSTO 2010 will install. If you have the later, it won't. – Todd Main Jun 22 '10 at 07:55
  • 1
    @Otaku: Yes, Office 2007 can run side-by-side with Office 2003. I have this configuration now on my laptop. I have done it on four other computers. I have created add-ins with VS2k5 (for Excel and Word) and VS2k8 for (Outlook and OneNote). I do not have an opportunities for Office 2010 development, so do not have the software installed. – AMissico Jun 22 '10 at 07:58
  • @Otaku: Outlook has never supported side-by-side installation. This is the only exception that I can remember write now. (OneNote may be another exception.) – AMissico Jun 22 '10 at 08:04
  • @AMissico: Yeah, that's right on Outlook. My mistake to say all of Office. – Todd Main Jun 22 '10 at 15:46
  • @Otaku & @AMissico: thanks for the replies but we're running Office 2003 and definitely have VSTO installed when we installed VS2010 so I'm confident that @AMissico is right on this one. With regards to Office versions, we have Office 2003 on all our PCs as part of the SOE and we also have the Office 2007 compatibility pack and possibly some other components that our network admins have installed. However, the fact remains that we have Office 2003 installed and VSTO 2010 installed fine (probably because it found Office 2007 registry settings that are part of our SOE). Thanks for your answers. – Ben Robbins Jun 23 '10 at 01:58
  • @Ben Robbins: I've edited to reflect that VS2010 does not work with solutions designed for 2003. – Todd Main Jun 23 '10 at 02:11
1

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.

AMissico
  • 21,470
  • 7
  • 78
  • 106
0

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.

Community
  • 1
  • 1
kagali-san
  • 2,964
  • 7
  • 48
  • 87