Can VBE be invoked/used OUTSIDE of an Office Application?

心不动则不痛 提交于 2019-12-11 02:17:34

问题


This may be a silly question - I haven't found anything on Google about this. No new programs populate in the task manager when VBE is opened from an Office Application, and I don't see an executable that looks probable. DLL maybe?


回答1:


Some Office applications provide the Run method for the Application class. For example, see Run Excel Macro from Outside Excel Using VBScript From Command Line.

Yes, you can call VBA macro at runtime.

There are applications that don't provide any specific methods for that, for example, Outlook. In that case you can use the late-binding technology (see Type.InvokeMemeber) - see Calling Outlook VBA Macro from outside (VB/VBScript/C#).




回答2:


You can invoke a CommandBarButton's OnAction macro as a proxy for Application.Run.

For details, see this question How can I run a macro from a VBE add-in, without Application.Run?



来源:https://stackoverflow.com/questions/28094070/can-vbe-be-invoked-used-outside-of-an-office-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!