How to develop an excel 2010 VSTO on a machine with excel 2013?

-1

I am developing an Excel 2010 VSTO project - my deploy machines have Excel2010 setup which can't be upgraded (production machines).

My development machine has Excel 2013 (again, due to IT I can't downgrade it to Excel 2010).

How can i develop such a project?

Trying to run the Excel 2010 VSTO project (from VS, either release or Debug) gives me an error message...

You cannot debug or run this project, because the required version of the Microsoft Office application is not installed.

and after clicking OK, i receive:

Unable to start debugging. Operation not supported. Unknown error: 0x80070057.

c#
visual-studio-2017
excel-2010
vsto
asked on Stack Overflow Dec 19, 2018 by NirMH • edited Dec 19, 2018 by NirMH

1 Answer

0

It is possible to develop a VSTO project against a later version of Office than that installed on the target systems. In order to do so, the project must base on .NET Framework 4 or later. Choose the project template for the version of Office installed on the development machine.

Set "Embed interop types" to True for all the Office libraries referenced in the project. This will make the object libraries version-independent.

It's also important to not use any functionality introduced after the earliest version of Office being targeted. If the code tries to use functionality introduced in Excel 2013, for example, this code cannot run in Excel 2010.

For more information see https://docs.microsoft.com/en-us/visualstudio/vsto/running-solutions-in-different-versions-of-microsoft-office?view=vs-2017 and https://docs.microsoft.com/en-us/visualstudio/vsto/designing-and-creating-office-solutions?view=vs-2017

answered on Stack Overflow Dec 19, 2018 by Cindy Meister

User contributions licensed under CC BY-SA 3.0