Advanced search complete event not firing in VBA

前端 未结 2 650
深忆病人
深忆病人 2021-01-27 18:41

As the title suggests I cannot get the advanced search complete event to fire. I am running VBA through Excel 2013. I have a sub running in worksheet1 which creates a test objec

相关标签:
2条回答
  • 2021-01-27 18:56

    To allow raising events you need to declare your objects with WithEvents

    Dim WithEvents myOlApp As New Outlook.Application
    
    0 讨论(0)
  • 2021-01-27 19:00

    The AdvancedSearchComplete event has a special procedure name which the compiler needs to see in order to tie your code to the event. Change the procedure name to:

    Private Sub Application_AdvancedSearchComplete(ByVal SearchObject As Search)
    
    0 讨论(0)
提交回复
热议问题