title: Get instance of Excel application with C# by Handle
body: <p>I have a c# simple application that have to write some values in a excel ranges of a specific worksheet.
  I create an instance of Excel application if not exist, but if exist i want to set active it and take an instance if it to use in my code.</p>
  
  <p>I use this code to create a new application:</p>
  
  <pre><code>Microsoft.Office.Interop.Excel app = 
     new Microsoft.Office.Interop.Excel.Application();
  app.Visible = true;
  </code></pre>
  
  <p>To get the handle of active excel window i use this api</p>
  
  <pre><code>[DllImportAttribute("User32.dll")]
  private static extern int FindWindow(String ClassName, String WindowName);
  </code></pre>
  
  <p>How can i get an instance of excel application by an handle?</p>
  
  <pre><code>int hWnd = FindWindow(null, "Microsoft Excel - MySheet.xlsx");
  Microsoft.Office.Interop.Excel app = ....(hWnd)
  </code></pre>