将Excel 2010加载项转换为2007加载项(均为VSTO) [英] convert an Excel 2010 addin to a 2007 addin (both VSTO)

查看:221
本文介绍了将Excel 2010加载项转换为2007加载项(均为VSTO)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Excel 2010加载项,以前是Excel 2007加载项。
我认为在转换计算机的过程中某个地方转换了该加载项。

I am currently working on an Excel 2010 add-in which formerly was an Excel 2007 add-in. Somewhere in the process of switching computers, the add-in was converted i think.

我的一些客户表示该加载项无法正常工作再次在Excel 2007上运行,因此我尝试在安装了Excel 2007和Visual Studio 2010的VirtualBox中对其进行调试。

Some of my customers stated that the add-in wasn't working on Excel 2007 anymore so I tried to debug it in a VirtualBox with Excel 2007 and Visual Studio 2010 installed.

现在我收到错误消息:


由于未安装所需的Microsft Office应用程序版本,因此无法调试或运行此项目。

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

我启动了一个新的Excel 2007加载项项目,并试图找出差异之处,并提出了与dll有关的想法,因此我更改了2010加载项,直到看起来像是2007年的插件。

I started a new Excel 2007 add-in project and tried to find what the differences are and came up with the idea that it somewhat has to do with the dll's so I changed my 2010 addin until it looked like an 2007 addin.

我仍然收到错误消息,指出我的项目无法调试。

I still get the error message stating that my project can't be debugged.

有什么我忘了更改的东西吗?

Is there anything I could've forgotten to change.

不幸的是,写一个全新的插件不是一种选择。

Writing a completely new addin is unfortunately not an option.

这些qu到目前为止,概念对我没有帮助:

These questions haven't helped me so far:


  1. 适用于Excel 2007和2010的Excel Addin

  2. 部署Office 2010插件

  1. Excel Addin that works on Excel 2007 and 2010
  2. Deploying Office 2010 addin


推荐答案

要使 VS 2010 Office 2007 一起使用,请修改项目文件( .csproj ),以便将其打开在Office 2007中运行,而在运行时不查找Office 2010(因此出现以上错误消息)。

To get VS 2010 working with Office 2007 modify the project file (.csproj) so that it will open in Office 2007 and not look for Office 2010 when run (hence the error message above).

这是项目设置更改( Excel示例):

Here is the project settings change (Excel example):

源XPath:


// Project / ProjectExtensions / VisualStudio / FlavorProperties / ProjectProperties / @ DebugInfoExeName

//Project/ProjectExtensions/VisualStudio/FlavorProperties/ProjectProperties/@DebugInfoExeName

旧值(Office 2010):


DebugInfoExeName =#Software\Microsoft\Office\14.0\Excel\InstallRoot\Path#excel.exe

DebugInfoExeName="#Software\Microsoft\Office\14.0\Excel\InstallRoot\Path#excel.exe"

新值(Office 2007):


DebugInfoExeName =#Software\ \Microsoft\Office\12.0\Excel\InstallRoot
\Path#excel.exe

DebugInfoExeName="#Software\Microsoft\Office\12.0\Excel\InstallRoot \Path#excel.exe"

之后更改此项目设置后,在启动调试器( F5 )时,它将加载Excel 2007应用程序,而不是查找Excel2010。

After changing this project setting, when you fire up the debugger (F5) it will load the Excel 2007 application instead of looking for Excel 2010.

这篇关于将Excel 2010加载项转换为2007加载项(均为VSTO)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆