title: .net detect if Office.interop.Excel exists
body: <p>I need to use <code>Excel</code> if it is installed on the target machine, or produce a <code>text</code> file if it is not. </p>
  
  <p>I check for the presence of the <code>excel application</code> registry key, but before I can do that, I get a </p>
  
  <pre><code>System.IO.FileNotFoundException: Could not load file or assembly Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c
  </code></pre>
  
  <p>or one of its dependencies. </p>
  
  <p>How can I detect if an <code>interop</code> assembly is available and prevent the <code>run-time</code> trying to load it if it isn't. (I don't know what version of <code>Excel</code> may exist on the target, so I don't think I can redistribute an <code>interop</code> in case its the wrong one.)</p>