拦截Excel打开文件

发布于 2024-12-14 19:22:19 字数 143 浏览 6 评论 0原文

有没有办法通过 COM 插件拦截或覆盖 Microsoft Excel 的文件打开命令?我想在 Excel 尝试打开工作簿之前处理该文件,因此 Application_WorkbookOpen 为时已晚。

理想情况下,双击 Excel 文件时也应该触发它。

Is there a way to intercept or override Microsoft excel's File open command by an COM Addin? I want to process the file before Excel tries to open the workbook, so Application_WorkbookOpen is too late.

Ideally it should be triggered when an excel file is double-clicked also.

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

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

发布评论

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

评论(1

薄凉少年不暖心 2024-12-21 19:22:19

使用:

Public Sub Auto_Open()

End Sub

它甚至可以在 Application_WorkbookOpen 之前运行。但不确定它对你来说是否足够快。

更新:

这可能对您也有帮助。< /a> 自动执行宏的不同方法:

AutoExec
AutoNew 
AutoOpen 
AutoClose
AutoExit

Use:

Public Sub Auto_Open()

End Sub

It works even before Application_WorkbookOpen. Not sure if it is fast enough for you though.

Update:

This might be helpful for you too. Different ways to auto execute macros:

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