title: how to generate excel file for a windows application using C# .net and a web application using C# ASP.NET
body: <p>How to generate Excel file in the following 2 scenarios:</p>
  
  <ol>
  <li>For a Windows application using C# or VB .NET</li>
  <li>For a Web application using C# or VB ASP.NET</li>
  </ol>
  
  <p>BUT without creating a local copy of the file. I want the Excel file to be generated in memory and open the file when generated. In case of the Web application I want it to show the download prompt before opening the generated Excel file.</p>
  
  <p>An example would be really appreciated. </p>
  
  <p>Thanks</p>