Excel 2010 AddIn in Excel 2013 Migration

Some time ago I’ve had a problem with upgrading my Excel 2010 AddIn. My AddIn works great on another machine where I’ve had Microsoft Visual Studio 2012 + Microsoft Excel 2010, but when I wanted to add sth into my code and upgrade my AddIn to Excel 2013 on second machine with Microsoft Visual Studio 2012 + Microsoft Excel 2013 during the debugging I have had the following error:

“You cannot debug or run this project, becouse the requied version of the Microsoft Office application is not installed”

3

4

To reapet this error let’s create new Excel 2010 AddIn in Visual Studio 2012. Note, that if you have no project templates for Office 2013 you can download them from here: http://blogs.msdn.com/b/vsto/archive/2013/03/06/office-developer-tools-for-visual-studio-2012-now-available.aspx

1

And let’s add some simple code.

2

Now, if you run the project you will se the previous error. This is becouse of the target Excel version of the project and version of some references: Office and Microsoft.Office.Intrerop.Excel.

5

To handle with it you have to make a two steps. First of all replace the old references with new ones. So, replace the Office and Microsoft.Office.Intrerop.Excel from version 14 (Excel 2010) to librares for version numer 15 (Excel 2013). You can find them in: C:Program Files (x86)Microsoft Visual Studio 11.0Visual Studio Tools for OfficePIAOffice15 (defalt installation)

6

Ignore all of the errors in your project for now and close the Visual Studio. The second step is to change the target Excel version. Navigate to your project folder and edit (outside of the VIsual Studio) your csproj

7

And in the “Project Extension” section replace the “OfficeVersion” from 14 to 15 and in the DebugInfoExeName directory adress replace the folder name from 14 to 15.

8

9

Open your project again, clean and build the project (you should have no errors or warnings becose of the changes) and now yo will be able to debug your project in Excel 2013.

10

Leave a Comment

Your email address will not be published. Required fields are marked *