Application_SheetSelectionChange事件在Vista中停止触发/有时在XP中触发 [英] Application_SheetSelectionChange Events stop firing in Vista /sometimes in XP

查看:211
本文介绍了Application_SheetSelectionChange事件在Vista中停止触发/有时在XP中触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VSTO3.0,Excel2007,OS-Wim2k3开发一个excel插件项目。启动这个adad我正在使用SheetSelectionChange事件,它工作正常但是从最近几天事件本身没有解雇。我无法解决问题,无处可以得到任何例外。任何人都有任何解决方案请分享。



谢谢,
Patro

解决方案

您好,

您是否使用类级别变量来存储工作簿以防止它被GC收集? br>它应该以这种方式工作:

Excel.Workbook wb;
Void ThisAddIn_Startup()
{
wb = Application.ActiveWorkbook;
wb.SheetSelectionChange + = ... .............搜索结果}搜索结果,由于

Hi,
I am developing one excel addin project  using VSTO3.0,Excel2007,OS-Wim2k3.On startup of thisaddin i am using  SheetSelectionChange event,It was working fine but from last few days the event itself is not firing .i am unable to figuredout the problem ,nowhere i am getting any exception.Anybody has any solution please share .


Thanks,
Patro

解决方案

Hi ,

Have you used a class level variable to store the Workbook in order to prevent it collected by GC?
It should work in this way:

Excel.Workbook wb;
Void ThisAddIn_Startup()
{
    wb= Application.ActiveWorkbook;
    wb.SheetSelectionChange+=................

}

Thanks


这篇关于Application_SheetSelectionChange事件在Vista中停止触发/有时在XP中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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