Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5844505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:18:06+00:00 2026-05-22T12:18:06+00:00

In a web application, I am generating a spreadsheet XML using an XSL template

  • 0

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

Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "Attachment;Filename=export.xls");
Response.Charset = "";

This opens the file in Excel, but because of the extension hardening feature of Excel 2010, displays the prompt –

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?

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.

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.

Any ideas, to open the spreadsheet xml in Excel, without the prompt?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:18:07+00:00Added an answer on May 22, 2026 at 12:18 pm

    This blog helped me workaround my problem.

    https://ralph.blog.imixs.com/2013/02/16/how-to-generate-a-excel-sheet-with-xslt/

    The trick is to add this processing instruction in your XSL template in the way mentioned in the above post.

    <xsl:processing-instruction name="mso-application">   
    <xsl:text>progid="Excel.Sheet"</xsl:text>  
    </xsl:processing-instruction>
    

    By doing this, you can specify the file extension as .xml, but it will open in Excel by default.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am exporting a gridview to excel, using .Net 4.0 in a web application,
Using mysql, c#.net, Java Script I have the web application, i want to create
We're currently generating reports for our web application using html5 / css3, and they
We are using Itext for generating the PDF's in our web application. The PDF's
In my web application, I am generating a SVG file which contains a header
In my web application, I am generating a document with a custom extension and
I have a web application in Spring that has a functional requirement for generating
Possible Duplicate: Generating random results by weight in PHP? I have a web application
I am designing a web application where i want to use maximum of struts
I'm using Haml as my templating language in a Sinatra-based web application, and I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.