vba Excel Workbook Open 事件来自加载项?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8419728/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Excel Workbook Open event from within an addin?
提问by Austin
I am trying to trigger a macro to run when an Excel document is opened.
我试图在打开 Excel 文档时触发宏运行。
The problem I am running into is that all of my code resides within an Excel add-in. The Workbook_Open event doesn't work because I can't put the code in individual documents, I need it to reside in the add-in and run whenever any document is opened.
我遇到的问题是我的所有代码都驻留在 Excel 加载项中。Workbook_Open 事件不起作用,因为我无法将代码放入单个文档中,我需要它驻留在加载项中并在打开任何文档时运行。
Is there a way to modify the Workbook_Open event or is there another way to trigger a macro when a different document is opened?
有没有办法修改 Workbook_Open 事件,或者有没有另一种方法在打开不同的文档时触发宏?