同时使用两个 VBE
我刚刚接手了工作中一些非常可怕的遗留 vba 的维护工作。当我有空闲时间时,我基本上会在新模板中重组和重写它。有时,我会设法利用某种故障并同时打开两个不同的 VBE 实例。我不知道我到底做了什么来实现这一点,但这让我的生活变得更轻松,所以我想知道是否有其他人知道。我认为这与将 Word 作为新实例运行有关,但我无法更改工作电脑上的文件类型设置。
编辑:我通常复制并粘贴到 Excel 中并以这种方式执行此操作,但这并不理想,因为我还在工作的其他部分使用大量 Excel 宏
I've just taken over maintenance of some pretty scary legacy vba at work. When I have spare time I'm essentially restructuring and rewriting it in new templates. Every now and then, I've managed to exploit a glitch of sorts and have two different instances of the VBE open at once. I don't know exactly what I did to make this happen, but it makes my life much easier, so I'm wondering if anyone else knows. I assume it's something to do with running Word as a new instance, but I can't change my file type settings on my work PC.
Edit: I usually copy and paste into Excel and do it this way, but this is not ideal because I also use a lot of Excel macros for other parts of my job
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
Application.Run
在另一个 VBA 主机中执行代码,并且可以跨 VBE 执行代码。You can use
Application.Run
to execute code in another VBA host, and you can step into the code across the VBEs.尝试通过代码打开 Word:
您应该获得第二个实例。
Try opening Word through code:
You should get a second instance.