Add a .NET EXE as a VBA Reference (within Excel) for COM Interop
<p>How can I use my C# project within Excel (VBA) when it is in executable form?</p>

<p>In Visual Studio, if I go to my project settings and change the "Output Type" to "Class Library", then I can successfully add a reference to my project in Excel VBA (by browsing to the DLL in the references section).</p>

<p>However, when my "Output Type" is set to "Windows Application", if I attempt to add a reference (within Excel VBA) to the newly generated EXE file, I receive the following error:</p>

<blockquote>
  <p>Can't add a reference to the specified file</p>
</blockquote>

<p>How can I reference my .NET EXE within Excel VBA?</p>

<p>(My purpose for using an exe rather than a DLL is so that my application can be used both as a Windows Application and as a COM object)</p>