Excel 2007 VSTO 加载项即使成功安装后也不可见
我对 excel 2007 插件行为有点困惑。任何想法都受到高度赞赏。 这是我按时间顺序正在做的事情。
- 我有一个 excel 2007 VSTO 插件,它构建和调试文件,因此我将其发布到一个文件夹,
- 我转到该文件夹并运行安装插件的安装程序。下次当我打开 Excel 时,插件是可见的。到目前为止很完美!
- 然后我转到 Excel Office 按钮 --> Excel 选项 --> 插件 -->管理--> COM插件 并删除我刚刚安装的插件。这使得该插件远离我的 Excel 功能区。到目前为止,正如预期的那样!
但此时我的插件已安装,并且仅从活动插件列表中删除。正确的 ?如果正确,我该如何重新添加它,因为我在非活动插件列表中看不到它。我恢复它的唯一方法是将其从“添加/删除程序”中删除,然后重新安装并重新启动 Excel。
这是唯一的方法还是我可以以某种方式重新添加插件,因为它已经安装了。
I am bit confused with the excel 2007 addin behaviour. Any ideas is highly appreciated.
Here is what I am doing in chronological order.
- I have a excel 2007 VSTO addin and it build and debugs file so I Publish it to a folder
- I go to the folder and run the Setup which installs the addin . Next time when I open excel the addin is visiable. So far perfect !!
- Then I go to Excel Office button -->Excel Options -->Addins --> Manage --> COM Addins
and remove the addin that I just installed. This makes the addin go away from my excel ribbon. So far as expected !!
But at this point my addin is installed and is only removed from the list of active addins. Correct ? If it is correct how do I re-add it , because I cannot see it in list of inactive addins. The only way I get it back is to remove it from Add/Remove Programs and reinstall and restart excel.
Is this is only way or I can re-add the addin somehow since it is already installed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
据我所知,这是 VSTO 的问题。对于普通的 COM 插件,您可以打开 Com Addin 窗口,单击 ADD 按钮并选择您的插件的 dll。
但对于 VSTO,这不起作用,因为 VSTO dll 不是非常“正常”的 COM dll。对于 VSTO,您必须将 Excel 指向 .VSTO 文件,但您无法从 Excel 本身内部执行此操作,只有安装程序才能实现这一点。
As far as I know, that's a problem with VSTO. With normal COM addins, you can open the Com Addin window, click the ADD button and select your addin's dll.
But with VSTO, that doesn't work, since VSTO dll's are not quite "normal" COM dlls. For VSTO, you have to point Excel at the .VSTO file, but you can't do that from within Excel itself, only an installer can make that happen.
插件的加载是通过注册表项控制的。VSTO
插件的不同之处在于它们不直接作为 dll 加载,而是通过某种加载器加载。所有 vsto 插件的加载程序都是相同的,并且知道要通过清单(.vsto 文件)加载哪个程序集。
在不重新安装的情况下将插件放回到列表中需要您恢复它的注册表项
如果导出将您的插件的注册表添加到 .reg 文件中,稍后只需双击 reg 文件即可重新启用它。
可以在此处找到所需的密钥: http://msdn.microsoft.com/en -us/library/ff937654.aspx)(搜索清单)
Loading of addins are controlled through registry keys
VSTO addins are different in the sense that they don't load directly as a dll but through some sort of loader. The loader is the same for all vsto addins and knows what assembly to load through a manifest (the .vsto file)
Getting the add-in back in the list without reinstalling requires you to restore the registry entry for it
If you export the registry hyve for your addin to a .reg file you can reenable it later by simply double clicking the reg file.
The required keys can be found here: http://msdn.microsoft.com/en-us/library/ff937654.aspx) (Search for manifest)
我认为上面的答案太复杂了:
答案:
答案:我认为这就是您想要做的:
问候,约尔格
I think the answer above is too complicated:
Answer:
Answer: I think that was what you wanted to do:
Regards, Jörg