在打开工作簿时需要控制宏的运行 [英] Need to control running of Macro during openning of Workbook

查看:140
本文介绍了在打开工作簿时需要控制宏的运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

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


这篇关于在打开工作簿时需要控制宏的运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆