title: Methods to compile an Excel spreadsheet into a .NET assembly?
body: <p>I have a spreadsheet that I'd like to compile into a form that I could call from C#.</p>
  
  <p>Naturally, I'd like to be able to change the inputs to the spreadsheet before reading the calculated result.</p>
  
  <p>What is your recommended method?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>To clarify, I want to make an existing Excel spreadsheet available as a web service that is callable from .NET. I can't have a dependency on Excel, as its running on a web server.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I used the answer below, and it worked like a charm. Now I can prototype a formula in Excel, then convert it straight into C# and compile it into an assembly.</p>
  
  <hr>
  
  <p>This question is also covered under <a href="https://stackoverflow.com/questions/1273116/reading-excel-files-as-a-server-process">Reading Excel Files as a Server Process</a>.</p>