Vba 宏可以工作,但无法在 main() 中启动

发布于 2025-01-15 08:12:51 字数 382 浏览 2 评论 0原文

已为 Solidworks 创建了一个宏 - 多个子程序、函数和表单。

我确信该代码是可疑的,但当我强制它在 main() 中启动时它会起作用

当我在 Solidworks 中添加一个按钮来启动宏时,它默认为不同的子项,该子项似乎是按字母顺序排列的,我得到了类似的行为从编辑器启动宏。 看来列出的所有潜艇都是没有传入参数的潜艇。

有人可以指导我为什么会发生这种情况吗?我确信我可以通过重命名潜艇来解决这个问题,但我真的不想这样做。

输入图片此处描述

Have created a Macro - multiple subs, functions and forms for Solidworks.

I'm sure the code is dubious but it works when I force it to start in main()

When I add a button in Solidworks to start the macro it defaults to a different sub, which appears to be alphabetical, I get a similar behaviour starting the macro from the editor.
It appears all the subs listed are the ones with no arguments passed in.

Could anyone please guide me on why this happens? I'm sure I could frig a way around by renaming the subs, but don't realy want to.

enter image description here

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

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

发布评论

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

评论(1

不…忘初心 2025-01-22 08:12:51

看来我又太不耐烦了!

在 Solidworks 中添加宏按钮时,您可以选择要运行的子程序...作为方法
输入图片此处描述

It appears I was to impatient, again!

When adding the macro button in Solidworks you are given the choice of choosing the sub to run ... as Method
enter image description here

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