View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bruce Rob Bruce is offline
external usenet poster
 
Posts: 10
Default Capture Excel Events from other application

George wrote:
Who know how to capture excel event for example 'Workbook_BeforeClose'
from other application for example MSWord. Using WithEvents in MSWord
class doesn't work, so I guess it impossible to do that.


Setting a reference (early binding) to Excel and then declaring:

Private WithEvents m_objExcel As Excel.Application

Gives me access to:

Private Sub m_objExcel_WorkbookBeforeClose(ByVal Wb _
As Excel.Workbook, Cancel As Boolean)

End Sub

So it does work, and is possible.

HTH

--
Rob

http://www.asta51.dsl.pipex.com/webcam/