2011-02-08 99 views
4

我正在編寫一個應用於2007和2010年的Excel Addin。當我使用Visual Studio創建一個新項目時,我需要決定需要哪個版本。我之前選擇了2007年,但自從我安裝了2010年後,我無法調試它。我得到一個錯誤:適用於Excel 2007和2010的Excel Addin

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

這是我的理解,如果我瞄準2007年,我應該能夠在2007年和2010年上運行它。這是正確的嗎?如果是這樣,我可以使用2010進行調試嗎?

+0

你是否設法使它工作?你是怎麼做到的?我創建了2010加載項,並在Office 2010上進行了測試,並且一切似乎都很順利。但是我不知道如果我轉向2007年的環境會不會導致問題。 – woodykiddy 2011-09-14 07:34:14

回答

0

A shared Add-in is made from a Visual Studio project creating a Com Add-In implementing the IDTExtensibility2 interface. This grants you access to the Excel model (workbooks, worksheets, Range, ...). This kind of project is still today what looks the most like a C# XLA. They are often used for formal commercial development deployed to external clients. While they are more difficult to make and maintain, they do give you deeper control over the Add-in and can be made somewhat version-agnostic (that is, you can use your own IA instead of a specific Office PIA library, and/or can do more in late binding to handle multiple Office versions with lower risks of compatibility problems).

這裏:http://metasharp.net/index.php?title=Csharp_and_Excel_Interoperability

0

你可以通過在你建立的項目,你會得到一個補丁文件,在加一起創建於2010年Excel中的插件先走用戶可以在安裝前,安裝補丁。使用excel 2007的系統添加。