Open an Excel File in Excel, not HTML

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I did a rather extensive Google search and either I didn't enter the
right keywords, or the information isn't out there.  I also looked to
find newsgroups for browsers, but none were active.  So here is my
question, and perhaps you can either help me or point me to the right place.

I have an Excel file residing on the server.  When the user clicks a
button to I send a stream with the following header info:

Content-type: application/octet-stream
Content-Disposition: attachment; filename=something.xls
Pragma: no-cache
Expires: 0

followed by the html description of the Excel table.

What results is a prompt to either open or save the file.  So far so good.

In my browsers, if I choose "open" they open an Excel spreadsheet.  This
is the desired behavior.  However, some people have it open as an HTML
page.  (They have Excel installed on their machines).  I believe that
this is a browser setting.  However, search as I have tried, I cannot
seem to find the proper settings to make it open in Excel.

Can someone please give me either the answers or pointers to them for at
least IE and Firefox?


Re: Open an Excel File in Excel, not HTML


On Mon, 07 Jul 2008 18:18:43 -0400, sheldonlg wrote:

Quoted text here. Click to load it

What on earth does that mean?  Are you sending html or excel?

If Excel, then try setting the correct content type, something like
application/x-ms-excel.  MS do document these somewhere.

If you are sending an html table and would like it to be opened in Excel,
then you are simply not allowed.  By sending the wrong filename extension
you are trying to exploit a bug in some versions of Internet Explorer,
which is quite a dubious thing to do.  It is certainly not a "feature"
that is meant to be used that way.


Re: Open an Excel File in Excel, not HTML

viza wrote:
Quoted text here. Click to load it

There is a table description that, when put on an html page, would show
as a table.  IOW, <table><tr><td> ..... etc.

Quoted text here. Click to load it

I am using a setup that I downloaded from the internet and it works (at
least on my computer).  However, I see your point.  I will change the
Content-type and see what happens.

Site Timeline