如何在 Windows 7 中从命令行激活 Excel 加载项?
目前我正在编写 VB 函数并将它们保存为 Excel 插件 .xlam 文件。
我想要一个 .bat 脚本,以便快速部署这些插件。
目前,要激活我的 .xlam 插件,我必须打开 Excel - 文件 - 选项 - 插件 - 浏览到插件文件...
,如下图所示。这绝对是手动的、重复的、手动的。做很累的事。
所以我的需要是自动化激活过程。
Currently I'm writting VB functions and save them as an Excel addin .xlam file.
I want to have a .bat script so as to quickly deploy those addins.
Currently, to activate my .xlam addins, I have to Open Excel - File - Option - Addins - Browse to addin files...
as below screenshot. This is absolutely manual, repeated & tiring thing to do.
So my need is to automate the activation process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
今天早上我一直在寻找完全相同的东西。我最终会尝试这样的事情,但我还没有。所以,这是我到目前为止所得到的:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.addins2.add.aspx
这是有关如何从 C# 使用 Excel 自动化的示例。从我看来,所有这些自动化接口都是真正的 COM 接口,因此您不限于 C# 或 Visual Basic(也许您可以使用一些花哨的 Windows 脚本来使用它们?我将尝试使用 python 和 pywin32,但这只是因为它适合我的口味)。
然后,要注册插件,请检查此方法:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.addins2.add.aspx
我实际上在某处看到了一个关于如何使用它的示例,但我不能立即找到它。
无论如何,这些只是想法。我很想知道这一切如何结束;-)
I was looking for exactly the same sort of thing this morning. I will eventually try something like this out, but I haven't yet. So, here is what I have come to so far:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.addins2.add.aspx
This is an example about how to use Excel automation from C#. From what I see, all these automation interfaces are really COM interfaces, so you are not restricted to C# or Visual Basic (maybe you can use some fancy scripting of Windows to work with them? what I will try is to use python with pywin32, but that's only because it suits my taste).
Then, for registering the addin(s), check this method:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.addins2.add.aspx
I actually saw an example somewhere about how to use it, but I can't find it right now.
Anyway, these are just ideas. I'm very interested on knowing how it all ends ;-)
您可以将此代码插入“ThisWorkBook”工作表中的 *.xlam 中,只需打开此代码即可安装并激活当前的 AddIns
you can insert this code in your *.xlam in the sheet "ThisWorkBook" this code install and activate the current AddIns, just by opening
手动添加一次后,我们可以通过将插件文件复制到 Excel
addin lair
来更新插件。这是执行此操作的 .bat 脚本。希望有帮助!
After one manually added time, we can update the addin by copy the addin file to Excel
addin lair
. Here is the .bat script to do it.Hope it helps!