Word/VBA 应用程序的实际限制

发布于 2024-08-19 07:25:13 字数 354 浏览 3 评论 0原文

我工作的公司有一个内部开发的 Word2003/VBA 应用程序,该应用程序的大小已经约为 6.5 mb,他们希望向其中添加额外的 200 多个宏,我认为这将使该应用程序变得更大。在我看来,这是一个糟糕的想法,但寻找资源来使用 VSTO 或其他一些更有用的技术重新开发该工具将是一个挑战。

所以我的问题是:

  • 在紧要关头,有一个 业务对Word的依赖 带有宏的模板为 10, 20, 还是 30 MB?
  • 是否有微软定义的或 建议限制(文件大小、数量 宏、复杂程度)到如何 您可以/应该扩展 VBA 应用程序 在它变得无法使用之前?

本质上,我想知道是否有令人信服的技术理由来硬着头皮重新开发这个应用程序。

The company I work for has an internally developed Word2003/VBA application that's already about 6.5 mb in size and they're looking to add an additional 200+ macros to it, which, I'm assuming, will make it much larger. This seems to me to be a terrible idea, but finding resources to redevelop the tool with VSTO or some other more useful technology will be a challenge.

So here are my questions:

  • Is it okay, in a pinch, to have a
    business dependency on a Word
    template with macros that's 10, 20,
    or 30 mb?
  • Is there a Microsoft-defined or
    suggested limit (file size, number of
    macros, level of complexity) to how
    far you can/should extend a VBA app
    before it becomes unusable?

In essence, I'd like to know if there is a compelling technical reason to bite the bullet and redevelop this app.

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

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

发布评论

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

评论(3

最好是你 2024-08-26 07:25:13

这将为您提供Word 2003/VBA 的限制:Word 中的操作参数限制和规范。鉴于限制为 150 个宏,他们似乎无法继续使用它来添加 200 多个宏。

This will give you the limits of Word 2003/VBA: Operating parameter limitations and specifications in Word. Given the limit is 150 macros, it doesn't look like they will be able to continue to use this to add 200+ macros.

懵少女 2024-08-26 07:25:13

我会考虑将其中一些宏移至外接程序。仍然是 VBA,但可以在多个文件上使用,并从数据中获取代码(这通常是编程的胜利)。

- 编辑 -
至于缩放和尺寸……我认为这一切都在设计中。如果将它们放在一起,性能就会受到影响。该文件可以处理总体大小,但模块大小 (64k) 和过程大小有限制(没有详细记录,但 IDE 会在您达到要求时通知您)。如果您开始接近 30mb 的文本,那么您将需要寻找其他解决方案。

您没有提到安全性,但由于这与医疗信息有关,因此应该说 VBA 不安全。如果代码是专有的,并且提供给外部源,您可能希望将其包装在 .xll 中并作为加载项安装。这实际上也可能提供更快的运行时间。

I would look at moving some of those macros to an Add-in. Still VBA, but can be used on multiple files and gets the code away from the data (which is a programming win, generally).

--Edit--
As for scaling and size... I think it's all in the design. If it is thrown together, performance will suffer. The file can handle the overall size, but there are limits to Module size (64k), and procedure size (not well documented, but the IDE will let you know when you've hit it). If you start to approach 30mb of text only then you're going to want to find another solution.

You haven't mentioned security, but since this has to do with medical information it should be said that VBA is not secure. If the code is proprietary, and being offered to outside sources you might want to wrap it up in an .xll and install as an add-in. This might actually offer a faster runtime as well.

王权女流氓 2024-08-26 07:25:13

我知道这是一个老问题。但似乎不太可能有 200 多个宏。除非他们已经制作了每个函数,或者子一个单独的宏,而不是将它们全部放在一个宏中。

您可以在字宏内编写 VBA 应用程序。但这听起来不像是的。它只是一堆宏。

I know this is an old question. But its seems unlikely there were 200+ macros. Unless they've made every function, or sub a seperate macro, instead of putting them all in the one Macro.

You can write a VBA application within a word macro. But this doesn't sound like it was. Its just a a bunch of macros.

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