VSTO问题 - 无法创建visual studio excel工作簿项目

时间:2022-01-31 20:43:13

When I try to create a Excel 2007 Workbook project, in Visual Studio 2008, I get the following errormessage:

当我尝试创建Excel 2007工作簿项目时,在Visual Studio 2008中,我得到以下错误消息:

Project cannot be created because the "Excel Visual Studio Design-Time Adaptor Add-in" is not working correctly. Excel might have disabled the add-in or made it inactive, or all add-ins might be disabled in your Trust Center settings. Check the add-in status in Excel Options. If the add-in is active and enabled, reinstall or repair Visual Studio Tools for Office.

无法创建项目,因为“Excel Visual Studio设计时适配器加载项”无法正常工作。 Excel可能已禁用该加载项或使其处于非活动状态,或者您的信任中心设置中可能禁用了所有加载项。在Excel选项中检查加载项状态。如果加载项处于活动状态并已启用,请重新安装或修复Visual Studio Tools for Office。

I have verified that the add-in is not inactive or disabled and I have tried to repair and uninstall/reinstall VSTO several times.

我已经验证加载项未处于非活动状态或已禁用,我已尝试多次修复和卸载/重新安装VSTO。

What to do?

该怎么办?

2 个解决方案

#1


5  

Just in case you haven't checked the trust settings, this MSDN page describes how to.

如果您尚未检查信任设置,则此MSDN页面将介绍如何操作。

I came across this on a MSDN forum:

我在MSDN论坛上遇到过这个问题:

For the repair to work, you'll have to run the VS Command Prompt with Admin Priviledges (right click, run as administrator). Then run this command line:

要使修复工作,您必须使用管理员权限运行VS命令提示符(右键单击,以管理员身份运行)。然后运行以下命令行:

C:>AddinUtil -AddInRoot:"%CommonProgramFiles%\Microsoft Shared\VSTA\AppInfoDocument" -Rebuild

C:> AddinUtil -AddInRoot:“%CommonProgramFiles%\ Microsoft Shared \ VSTA \ AppInfoDocument” - Rebuild

If it still doesn't work, you may also have a corrupt pipleline store, which can be fixed like this:

如果它仍然不起作用,您可能还有一个损坏的pipleline存储,可以这样修复:

C:>AddinUtil -PipelineRoot:"%CommonProgramFiles%\Microsoft Shared\VSTA\Pipeline" -Rebuild

C:> AddinUtil -PipelineRoot:“%CommonProgramFiles%\ Microsoft Shared \ VSTA \ Pipeline” - Rebuild

You'll get one warning from that command but that is expected.

您将从该命令获得一个警告,但这是预期的。

Failing that, I think you will have to run a repair on the Visual Studio 2008 installation (put the installation DVD in a drive, and select the repair option).

如果做不到这一点,我认为您必须在Visual Studio 2008安装上运行修复(将安装DVD放入驱动器,然后选择修复选项)。

#2


0  

I'd set Excel 2003 to open XLS files by default. I saw the same error message you got until I repaired Office 2007 from the Add/Remove Programs menu.

我默认将Excel 2003设置为打开XLS文件。在从“添加/删除程序”菜单中修复Office 2007之前,我看到了相同的错误消息。

#1


5  

Just in case you haven't checked the trust settings, this MSDN page describes how to.

如果您尚未检查信任设置,则此MSDN页面将介绍如何操作。

I came across this on a MSDN forum:

我在MSDN论坛上遇到过这个问题:

For the repair to work, you'll have to run the VS Command Prompt with Admin Priviledges (right click, run as administrator). Then run this command line:

要使修复工作,您必须使用管理员权限运行VS命令提示符(右键单击,以管理员身份运行)。然后运行以下命令行:

C:>AddinUtil -AddInRoot:"%CommonProgramFiles%\Microsoft Shared\VSTA\AppInfoDocument" -Rebuild

C:> AddinUtil -AddInRoot:“%CommonProgramFiles%\ Microsoft Shared \ VSTA \ AppInfoDocument” - Rebuild

If it still doesn't work, you may also have a corrupt pipleline store, which can be fixed like this:

如果它仍然不起作用,您可能还有一个损坏的pipleline存储,可以这样修复:

C:>AddinUtil -PipelineRoot:"%CommonProgramFiles%\Microsoft Shared\VSTA\Pipeline" -Rebuild

C:> AddinUtil -PipelineRoot:“%CommonProgramFiles%\ Microsoft Shared \ VSTA \ Pipeline” - Rebuild

You'll get one warning from that command but that is expected.

您将从该命令获得一个警告,但这是预期的。

Failing that, I think you will have to run a repair on the Visual Studio 2008 installation (put the installation DVD in a drive, and select the repair option).

如果做不到这一点,我认为您必须在Visual Studio 2008安装上运行修复(将安装DVD放入驱动器,然后选择修复选项)。

#2


0  

I'd set Excel 2003 to open XLS files by default. I saw the same error message you got until I repaired Office 2007 from the Add/Remove Programs menu.

我默认将Excel 2003设置为打开XLS文件。在从“添加/删除程序”菜单中修复Office 2007之前,我看到了相同的错误消息。