title: How to use use late binding to get excel instance?
body: <p>I'm using</p>
  
  <pre><code>[DllImport("Oleacc.dll")]
  static extern int AccessibleObjectFromWindow(
  int hwnd, 
  uint dwObjectID, 
  byte[] riid,
  ref Excel.Window ptr);</code></pre>
  
  <p>to get an Excel Instance using his handle, which I get from the process ID of the excel instance.</p>
  
  <p>This is how it looks like when I use these function</p>
  
  <pre><code>const uint OBJID_NATIVEOM = 0xFFFFFFF0;
  Guid IID_IDispatch = new Guid("{00020400-0000-0000-C000-000000000046}");
  Excel.Window ptr = null;  
  int hr = AccessibleObjectFromWindow(hwndChild, OBJID_NATIVEOM, 
            IID_IDispatch.ToByteArray(), ref ptr);
  
  Object objApp = ptr.Application;</code></pre>
  
  <p>This peace of code works great but the only problem is that I had to add a reference to the Office 2003 Primary Interop Assemblies.</p>
  
  <p>As you can see, the last param in the function is the reason why I needed to add the reference to the Pias, so my question is if there is a way of avoiding the use of Interop Assemblies, I have tried with late binding but perhaps I've been doing it wrong because I haven't been able to make it work.</p>