locked
VS2010 vs Excel 2003 add-in RRS feed

  • Question

  • I just installed VS2010  and tried updating a solution that includes a Excell 2003 add-in. When I tried to debug the added, I get an error message saying the required Office Application is not installed (it is).

    Just for grins, I tried creating a new Excel 2003 add-in solution and that is when I noticed that Office 2003 is no long included in the list of templates.

    Does VS2010 support developing Office 2003 add-ins?  How can I get the 2003 templates back?

    thanks,

     


    Software Developer
    Wednesday, April 14, 2010 4:17 PM

Answers

  • Visual Studio 2010 does not provide project templates or other direct support for creating Office 2003 add-ins (it supports only Office 2010 and Office 2007; each Visual Studio release typically supports the "current" version of Office and the immediately previous version). If you want official VSTO support for Office 2003 development, you must use either Visual Studio 2008 or Visual Studio 2005. 

    If Office 2007 or Office 2010 is not installed when you upgrade an existing Office 2003 project in Visual Studio 2010, then Visual Studio modifies the project to an Office 2007 project by default, so I'm guessing this is what the 'required Office application is not installed' message means in your case. For more information about upgrading Office projects to Visual Studio 2010, see http://msdn.microsoft.com/en-us/library/k2xkefex.aspx.  

    If you want to develop an Office 2003 add-in in Visual Studio 2010, I believe your only option is to create a basic COM add-in (not using the VSTO runtime) by using the Shared Add-in project template that is provided on the Other Project Types -> Extensibility node of the New Project dialog. Although COM add-ins provide greater flexibility in terms of the versions of Office and Office applications that you can target by using Visual Studio 2010, they also require more effort to implement most types of features, and you will also want to create your own shim to make sure that your add-in is loaded in its own AppDomain - see http://blogs.msdn.com/mshneer/archive/2010/03/19/com-shim-wizards-for-vs-2010.aspx for more information about COM shims.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, April 14, 2010 4:40 PM
    Answerer

All replies

  • Visual Studio 2010 does not provide project templates or other direct support for creating Office 2003 add-ins (it supports only Office 2010 and Office 2007; each Visual Studio release typically supports the "current" version of Office and the immediately previous version). If you want official VSTO support for Office 2003 development, you must use either Visual Studio 2008 or Visual Studio 2005. 

    If Office 2007 or Office 2010 is not installed when you upgrade an existing Office 2003 project in Visual Studio 2010, then Visual Studio modifies the project to an Office 2007 project by default, so I'm guessing this is what the 'required Office application is not installed' message means in your case. For more information about upgrading Office projects to Visual Studio 2010, see http://msdn.microsoft.com/en-us/library/k2xkefex.aspx.  

    If you want to develop an Office 2003 add-in in Visual Studio 2010, I believe your only option is to create a basic COM add-in (not using the VSTO runtime) by using the Shared Add-in project template that is provided on the Other Project Types -> Extensibility node of the New Project dialog. Although COM add-ins provide greater flexibility in terms of the versions of Office and Office applications that you can target by using Visual Studio 2010, they also require more effort to implement most types of features, and you will also want to create your own shim to make sure that your add-in is loaded in its own AppDomain - see http://blogs.msdn.com/mshneer/archive/2010/03/19/com-shim-wizards-for-vs-2010.aspx for more information about COM shims.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, April 14, 2010 4:40 PM
    Answerer
  • I tried the first workaround with a PowerPoint 2003 add in, but got this error message "The operation could not be completed. No such interface supported" when I try to load the project.  I have Office 2003 installed and it works fine in VS.NET 2008.  I guess to target Office 2003, 2007 & 2010 you need to have 2 solution files with 2 different versions of Visual Studio.  Seems like a lot of work for something so simple.
    Wednesday, April 28, 2010 5:23 PM
  • My apologies - after trying this out myself it does appear that the first workaround (clearing the Always upgrade to installed version of Office option in the Project Upgrade page of the Tools->Options dialog box before upgrading an Office 2003 VSTO add-in to Visual Studio 2010) does not work in this scenario. I should have read my own documentation more carefully - see the section about upgrading Office 2003 projects in http://msdn.microsoft.com/en-us/library/k2xkefex.aspx

    The main issue is that Office 2003 projects require the VSTO 2005 SE runtime, which is not included with Visual Studio 2010, and does not appear to be supported by the VSTO project system in Visual Studio 2010. I initially tried to work around this by installing the VSTO 2005 SE runtime on the development computer and modifying the assembly references to the VSTO 2005 SE runtime assemblies in the GAC, but then the generated code in the project (which is always updated as part of the project upgrade process) no longer compiles after doing this.

    So, in short, I believe the only option for developing Office 2003 add-ins in Visual Studio 2010 is to use a Shared Add-in project type. Generally, the Office developer tools in Visual Studio (a.k.a. VSTO) support development for the current release of Office and one version back. I modified my response above accordingly.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, April 28, 2010 7:43 PM
    Answerer