Excel and IE7 - Prevent IE from Opening Excel Files

I have an intranet web page that is used to hyperlink to various files on a file server.
The problem with linking a local file is that Microsoft Excel files open in IE7 instead of Excel.
This causes Excel VBA files and other functions to work correctly.

Is there a way to use HTML / Javascript to force the file to open in Excel instead of IE7?

+2


source to share


3 answers


it's been a long time, but i was doing something like this. Obviously this is server side code, I know you have specified javascript / html.

Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "attachment;filename=test.xls");

      



EDIT

Here's a decent enough example, albeit a little old http://aspalliance.com/259_Downloading_Files__Forcing_the_File_Download_Dialog

+6


source


Or in PHP you would do this:



 //send headers that should force download
 header('Content-Type: application/vnd.ms-excel');
 header('Content-Disposition: attachment; filename="downloaded.pdf"');
 // and output the file:
 readfile('file.xls');

      

+2


source


Ok if you're feeling a little naughty: http://support.microsoft.com/kb/162059

"" To configure Internet Explorer to open Office files in the appropriate Office program instead of Internet Explorer, use one of the following methods. ""

It won't help systems outside of your control ... unless of course you can convince them to run some privileged ActiveX / script, .reg file, or change settings as described ( I really don't recommend any of these ).

+2


source







All Articles