title: No Events when using reflection on Excel Application COM Object
body: <p>I have an Excel template that I use to link to my application via this method:</p>
  
  <p>Excel VBA:</p>
  
  <pre><code>objApp.SetExcelApp Application
  </code></pre>
  
  <p>Inside my application code, I want to use reflection to hook up to the WorkbookBeforeClose event on the Excel Application so I can do stuff when that event fires:</p>
  
  <p>VB.NET:</p>
  
  <pre><code>Public Sub SetExcelApp(ByRef objExcel As Object)
      Dim evWorkbookBeforeClose As Reflection.EventInfo = objExcel.GetType().GetEvent("WorkbookBeforeClose")
      Dim mEvents As Reflection.EventInfo() = objExcel.GetType().GetEvents()
      ' do stuff
  End Sub
  </code></pre>
  
  <p>Surprisingly, <code>evWorkbookBeforeClose</code> is <code>Nothing</code> - even <code>mEvents</code> is <code>Nothing</code>!</p>
  
  <p>I can use methods and properties completely fine. Like <code>objExcel.ActiveWorkbook</code> and <code>objExcel.Run("MyVBAMethod")</code></p>
  
  <p>Anyone have ideas why this doesn't work? Is this not possible using reflection? Do I have to add a reference to the Excel interop?</p>
  
  <p><strong>EDIT:</strong> So if I add the Excel interop as a reference, it will work fine, since I can just use <code>AddHandler</code> on the event. But I'd still like to know why this doesn't work using reflection...</p>
  
  <p>An interesting thing I saw was even when I changed this to <code>objExcel As Microsoft.Office.Interop.Excel.Application</code>, doing the above calls (<code>GetEvent</code>/<code>GetEvents</code>) <strong>still</strong> both return Nothing!</p>