Open Excel files outside of Internet Explorer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm rendering my datagrid to a HTML stream with a .xls extension to open in Excel however it opens in the browser. Is there a way to programatically force it to open Excel? I know you can configure a setting in windows explorer to do this but i want to do this without any client interaction

Thanks
 
Are you sending the content as an attachment with a name? That seems to work
for me... it launches Excel.
 
Some code like this should do the trick.
Response.AddHeader("Content-Disposition","attachment;filename=myfile.xls");

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net



Neil said:
Hi,

I'm rendering my datagrid to a HTML stream with a .xls extension to open
in Excel however it opens in the browser. Is there a way to programatically
force it to open Excel? I know you can configure a setting in windows
explorer to do this but i want to do this without any client interaction.
 
Back
Top