Save a Excel file with

I want to download a Excel file, but the browser open the file and not show the dialog "SaveAs..."
I trying with the execCommand and IFRAMES but not work with "xls" files!

<iframe id="SaveFrame" SRC="MyFile.xls" style="display:show"></iframe>

<INPUT TYPE="button" STYLE="width: 9em" VALUE="HTML Mode" ONCLICK="SaveFrame.document.('SaveAs',false,'ww.xls')">

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This is because Microsoft IE automatically detects the file as an Excel mime type. Microsoft has tightly integrated IE and Office products. There's no way around it.
If a user who tries to download the file has installed Microsoft Excel then it will load Excel. If the user has not installed Excel, it will start the download normally.
Can you use ASP? If so you can solve this server-side. If so, let me know.

Otherwise I'd probably .zip the file to force someone to download it.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

pserranorAuthor Commented:
I can use ASP, how I do it?

Check out the accepted answer, it has an example link.

Also, I used this sample code with VERY little modification and it works just fine for me:

Hope this helps!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pserranorAuthor Commented:
Thanks the example works!!
You're welcome. :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.