vba 共享/分发 Excel 宏的最佳方式是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7596623/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 11:57:43  来源:igfitidea点击:

What is the best way to share/distribute Excel macro?

excelvbasharedistribute

提问by user652061

I wrote the macro in Excel and want to distribute it to the users. Once opened I want the macro to add itself as a toolbar and then to be always visible whenever the Excel is opened. So the macro can be conveniently accessed used from all workbooks.

我在 Excel 中编写了宏并希望将其分发给用户。打开后,我希望宏将自身添加为工具栏,然后在打开 Excel 时始终可见。因此可以从所有工作簿中方便地访问宏。

回答by JMax

IMHO, the easiest way is to create an add-inwith your code and give it to the users.

恕我直言,最简单的方法是使用您的代码创建一个加载项并将其提供给用户。

See this link on ozgridto learn how to build addins.

请参阅ozgrid上的此链接以了解如何构建插件

回答by MikeD

For Sub's tied to toolbars an Addin - as said by JMax - would be my choice. For formulae specific to your business a regular empty Excel file with one or more modules containing Function Xxx(), placed in the Autostart folder would be sufficient.

对于绑定到工具栏的 Sub 来说,我会选择一个插件——正如 JMax 所说的那样。对于特定于您的业务的公式,将包含一个或多个包含函数 Xxx() 的模块的常规空 Excel 文件放在 Autostart 文件夹中就足够了。

A server directory which is added to the user's path of Autostart folders is an easy way to auto-distribute formulae.

添加到用户自动启动文件夹路径的服务器目录是一种自动分发公式的简单方法。

I am using the latter for instance for IP address calculations

例如,我使用后者进行 IP 地址计算