在打开工作簿时需要控制宏的运行

编程入门 行业动态 更新时间:2024-10-27 22:31:40
本文介绍了在打开工作簿时需要控制宏的运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Hello All, 我们为excel提供了一个自定义com加载项。我们重写了excel的workbook_open事件,以反序列化存储在activeX控件中的自定义数据。但是,如果工作簿包含一个宏,在打开工作簿时,它首先运行宏,然后它调用Workbook_open()函数中的方法。我们在Excel 2007和Excel 2010中都观察到这种情况。 如果工作簿包含宏,则根据excel行为和用户显示安全警告允许宏运行然后我们只想反序列化我们的数据。 如果有人遇到同样的问题,请分享一下这个问题。 在此先感谢!!! 问候, Vieer

Hello All, We have a custom com add-in for excel. We are overriding the workbook_open event of excel to de-serialize our custom data which is stored in the activeX control. But, if a workbook contains a macro, while opening the workbook it first runs the macro after that it calls our methods in the Workbook_open() function. This behavior we observed in both Excel 2007 and Excel 2010. We want to display the security warning to the user if a workbook contains macro as per excel behavior and if user allows macro to run then only we want to de-serialize our data. Please share something on this issue, if anybody faced same kind of issue. Thanks in Advance!!! Regards, Vieer

推荐答案

请参阅 msdn.microsoft/en-us/library/microsoft.office.interop.excel.workbooks.open(v = office.11​​)的.aspx [ ^ ]。

更多推荐

在打开工作簿时需要控制宏的运行

本文发布于:2023-10-24 09:56:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523639.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时需   工作

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!