Developing an add-in for multiple versions of Office (Mary Lee)

Published 20 March 08 12:42 PM

Theoretically, you can develop an add-in for multiple versions of Microsoft Office by catering to the lowest common denominator. This means if you use an Excel 2003 add-in template in Visual Studio 2008, you would be able to develop and debug this with Excel 2007. However if you try this, you may meet these error messages: "You cannot debug or run this project, because the required version of the Microsoft Office application is not installed.", followed by "Unable to start debugging."

You can develop an Office 2003 add-in but use the 2007 Microsoft Office system for debugging. The following procedure demonstrates how to update your Visual Studio debugging options to use Microsoft Excel 2007 to debug an add-in targetting Microsoft Excel 2003.

1. On the Project menu, click on ProjectName Properties.

2. Click on the Debug tab.

3. In the Start Action pane, click the Start external program radio button.

4. Click the file browser button and navigate to %ProgramFiles%\Microsoft Office\Office12.

5. Choose Excel.exe and click Open.

6. Press F5 to debug your add-in.

This procedure works because the .NET Framework runtime loads the 2007 Microsoft Office version of the primary interop assembly, even though the add-in was developed with the Microsoft Office 2003 PIA. For more information, see Office Primary Interop Assemblies.

Before you use a Microsoft Office 2003 template, consider the impact on your project. Because you created your project with an Excel 2003 add-in template, you can now develop with the .NET Framework 2.0. However, this means that you cannot use new features in Visual Studio 2008 that depend on .NET Framework 3.5.

For additional information, see Andrew Whitechapel's blog entry Can you build one add-in for multiple versions of Office? and the MSDN Library documentation Creating Solutions for Multiple Versions of Microsoft Office.

Mary Lee, programming writer.

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Martha said on April 17, 2008 3:20 PM:

I am having problems consuming a web service from Access2003. I can not find a complex type property from a method

# OBA Ramblings said on April 25, 2008 4:07 PM:

Over the past few weeks, I've attended and presented at a number of conferences (specifically VSLive,

# Andrew Coates ::: MSFT said on May 27, 2008 4:22 AM:

One of the common questions I get asked when I do sessions on VSTO / OBA development is "how can

# Aziz said on May 28, 2008 12:16 AM:

I've a 2003 excel add-in referencing the office 11.0 dll. I want to implement the IribbonExtensibilty and customise the ribbon for office 2007.

I tried creating a separate dll for the ribbon refferencing the office 12.0 dll and added this dll to my 2003 addin. It gives me the below error

"Assembly 'CustomRibbon,Version=12.0.0.0' which has a higher version than referenced assembly 'office, Version=11.0.0.0 ' "

please suggest a solution.

# andreww said on May 28, 2008 1:05 AM:

Aziz - you should read my blog post (which Mary's post does refer to) - this explains what the problem is, and a possible workaround: http://blogs.msdn.com/andreww/archive/2007/06/15/can-you-build-one-add-in-for-multiple-versions-of-office.aspx

# Aziz said on May 28, 2008 5:04 AM:

Hi Andrew!

I did read your blog.

I added the reference of office 12.0 to the 2003 add-in. It builds perfectly fine .

It worked for machine having office 2007 however failed on a machine having only office 2003 as explained by you in the blog.

Is there any work around for this addin to work with office 2003 also?

# Aziz said on May 28, 2008 5:04 AM:

Hi Andrew!

I did read your blog.

I added the reference of office 12.0 to the 2003 add-in. It builds perfectly fine .

It worked for machine having office 2007 however failed on a machine having only office 2003 as explained by you in the blog.

Is there any work around for this addin to work with office 2003 also?

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

About VSTO Team

This login represents the Visual Studio Tools for Office team. Many members of the team us this account for publishing technical blog posts.

This Blog

Syndication

Page view tracker