将插件打包到 DLL 中

发布于 2024-08-19 21:55:25 字数 209 浏览 1 评论 0原文

我有两个用 VBA 编写的 MS Office 加载项,我想将它们连同一些支持文件打包到安装程序中。由于保护加载项代码的 VB 密码很容易被破解,因此我想将加载项中的 VBA 代码“转换”为 DLL,然后从加载项调用 DLL。

将 VBA 代码“放入”DLL 中的选项有哪些? Visual Studio 可以处理这个问题吗?有什么好的链接可以提供有关此内容的一些非常基本的说明吗?谢谢。

I have two MS Office add-ins written in VBA that I would like to package into an installer, along with some support files. Since VB passwords protecting add-in code can be hacked pretty easily, I want to "convert" the VBA code in my add-ins to DLLs, then call the DLLs from the add-ins.

What are my options for "putting" VBA code in DLLs? Can Visual Studio handle this? Any good links that provide some very basic instruction on this stuff? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-08-26 21:55:25

由于没有其他人回答...尽管我使用过 VBA、VB6,并且编写了 VB6 DLL,这些 DLL 是其他第 3 方软件(尽管不是 Office)的加载项,但我没有这样做的个人经验。

最简单的方法是将 VBA 代码转换为 VB6 COM 插件。那么您不必更改代码的内部结构,因为 VBA 与 VB6 99% 相同,并且您可以针对相同的 Office 对象模型进行编码。您需要更改将加载项链接到 Office 的内务处理。以下是 2002 Microsoft MSDN 文章,介绍如何使用 VB6 编写 Office 加载项。

或者,您可以将 VBA 作为 VSTO 插件迁移到 VB.Net。完全支持 VB.Net,而现在仅支持 VB6 运行时。缺点是可能需要大量工作,需要学习和购买新东西 。您需要使用混淆器,否则您的.Net代码可能是比受密码保护的 VBA 更容易反编译

在您做出决定之前,请考虑有多少盗版者将攻击您的代码,如果他们破解代码会有多糟糕,以及如何阻止他们只是复制您的二进制文件(不进行反编译)?正确的答案可能是坚持使用 VBA 插件。

Since no-one else has answered... I have no personal experience doing this although I have used VBA, VB6, and have written VB6 DLLs that are add-ins for other 3rd party software (although not Office).

The easiest way would be to convert your VBA code to a VB6 COM add-in. Then you shouldn't have to change the guts of your code, since VBA is 99% identical to VB6, and you can code against the same Office object model. You would need to change the housekeeping that links your add-in into Office. Here's a 2002 Microsoft MSDN article on how to write Office add-ins in VB6.

Alternatively you could migrate your VBA to VB.Net as a VSTO add-in. VB.Net is fully supported, whereas only the VB6 runtime is now supported. The disadvantages are it could be a lot of work, with new stuff to learn and buy. You would need to use an obfuscator otherwise your .Net code could be decompiled even more easily than password protected VBA.

Before you decide, ponder how many pirates will be attacking your code, how bad it would be if they crack it, and what's to stop them just copying your binaries anyway (without decompiling)? The right answer might be just to stick with VBA add-ins.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文