Upgrade and migrate Office solutions

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

If you have a Microsoft Office project that was created in an earlier version of Visual Studio, you must upgrade the project to use it in current versions of Visual Studio. To upgrade a Microsoft Office project, open it in a version of Visual Studio that includes the Microsoft Office developer tools. For more information about the versions of Visual Studio that include the Microsoft Office developer tools, see Configure a computer to develop Office solutions.

Note

Interested in developing solutions that extend the Office experience across multiple platforms? Check out the new Office Add-ins model. Office Add-ins have a small footprint compared to VSTO Add-ins and solutions, and you can build them by using almost any web programming technology, such as HTML5, JavaScript, CSS3, and XML.

Note

Visual Studio cannot upgrade InfoPath form template projects that were created by using previous versions of Visual Studio. These types of projects are not supported in the current release of Visual Studio.

Changes to upgraded projects

When you upgrade a Microsoft Office project, Visual Studio modifies the project to target the following items:

  • The Visual Studio 2010 Tools for Office runtime. For more information, see Visual Studio Tools for Office runtime overview.

  • The current assembly references.

  • A version of the .NET Framework that is supported by the project type (When you upgrade to Visual Studio 2013 only).

  • A version of Microsoft Office that is supported by the project type (When you upgrade to Visual Studio 2013 only).

Assembly references

Visual Studio upgrades the following assembly references in the project:

  • Microsoft Office primary interop assemblies (PIAs).

  • Assemblies in the Visual Studio Tools for Office runtime. For more information about these assemblies, see Visual Studio Tools for Office runtime overview.

  • New or updated versions of dependent assemblies.

Targeted .NET Framework

When you upgrade a project to Visual Studio 2013, Visual Studio modifies the project to target either the .NET Framework 4.5 or the .NET Framework 4. The version of the .NET framework targeted by the project depends on what version of Office is installed on your computer. If Office 2013 is installed, Visual Studio modifies the project to target the .NET Framework 4.5. Otherwise, Visual Studio modifies the project to target the .NET Framework 4.

Note

You might need to perform some additional steps to run a retargeted solution on development and end-user computers, and your project will no longer compile if it uses certain features. For more information, see Migrate Office solutions to the .NET Framework 4 or later.

If you target the .NET Framework 4 or later in an Office project, you can use some features that are not available when you target the .NET Framework 3.5. For more information, see Design and create Office solutions.

Targeted Office application

When you upgrade an Office project to Visual Studio 2013, Visual Studio modifies the project to target a version of the Microsoft Office that is supported by the project type, such as a document-level customization project or VSTO Add-in project.

Office projects in Visual Studio 2013 can target Office 2013 and Office 2010 applications. Visual Studio modifies the project to target the latest version of office that you have installed. If none of these versions of Office are installed, Visual Studio does not upgrade the project.

Note

If you upgrade a VSTO Add-in project to target Office 2013 or later, make sure that the ThisAddIn_Startup event handler of the VSTO Add-in doesn't contain code that accesses a document in the application. For more information, see Access a document when the Office application starts.

For document-level customizations, Visual Studio converts documents in a project that have a binary format, such as documents that have an .xls or .doc extension, to the Office Open XML format. For more information about Open XML, see Introduction to new file name extensions and Open XML formats.

Note

Smart tags are deprecated in Excel 2010 and Word 2010. Therefore, if your solution uses smart tags, you must remove them before you can test and debug it in Visual Studio 2013 or Visual Studio 2015.

Upgrade Microsoft Office 2003 projects

There are some additional considerations for upgrading document-level customizations and VSTO Add-ins that target Microsoft Office 2003.

Document-level projects

If the document in the project contains Windows Forms controls, you must also have the Visual Studio 2005 Tools for Office Second Edition Runtime installed before you upgrade the project. If this version of the runtime is not installed on the development computer before you upgrade the project, the upgraded project might contain compile or run time errors. After you finish upgrading the project, you can uninstall the Visual Studio 2005 Tools for Office Second Edition Runtime from the development computer if it is not being used by any other Office solutions. This version of the runtime is available as a redistributable package from the Microsoft Download Center at Microsoft Visual Studio 2005 Tools for Office Second Edition Runtime (VSTO 2005 SE) (x86).

VSTO Add-in projects

If the solution file for your original project included a Setup or InstallShield Limited Edition project that was configured to install the VSTO Add-in, Visual Studio upgrades the project, but it does not make any further changes to the project. If you want to keep using a Windows Installer file to deploy your VSTO Add-in, you must modify the Setup or InstallShield Limited Edition project to install new pre-requisites such as the .NET Framework 4, the Visual Studio 2010 Tools for Office Runtime, and optionally the primary interop assemblies referenced by your VSTO Add-in. For more information, see Deploy an Office solution by using Windows Installer.

If you want to use ClickOnce to deploy your VSTO Add-in, you can delete the Setup or InstallShield Limited Edition project entirely. For more information about deploying VSTO Add-ins by using ClickOnce, see Deploy an Office solution.

See also