title: Open spreadsheet xml in Excel by default
body: <p>In a web application, I am generating a spreadsheet XML using an XSL template created from Excel 2010. I want this spreadsheet XML to open in Excel by default. So, I add the below properties to the response </p>
  
  <pre><code>Response.ContentType = "application/vnd.ms-excel";
  Response.AddHeader("Content-Disposition", "Attachment;Filename=export.xls");
  Response.Charset = "";
  </code></pre>
  
  <p>This opens the file in Excel, but because of the extension hardening feature of Excel 2010, displays the prompt - </p>
  
  <blockquote>
    <p>The file you are trying to open,
    'export[1].xls', is in a different
    format than specified by the file
    extension. Verify that the file is not
    corrupted and is from a trusted source
    before opening the file. Do you want
    to open the file now?</p>
  </blockquote>
  
  <p>If I click on yes, it opens up fine. But, is there a way the prompt can be completely skipped? I have read about the registry changes to disable the prompt in a user's machine. But, this is a public website and that solution will not work. </p>
  
  <p>I can set the attachment filename to export.xml. If I save it and open in Excel, there is no prompt. But the XML will not open in Excel by default. </p>
  
  <p>Any ideas, to open the spreadsheet xml in Excel, without the prompt?</p>