Can VBE be invoked/used OUTSIDE of an Office Appli

2019-07-24 07:35发布

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?

标签: ms-office vbe
2条回答
贼婆χ
2楼-- · 2019-07-24 07:42

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?

查看更多
疯言疯语
3楼-- · 2019-07-24 07:48

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#).

查看更多
登录 后发表回答