Open Excel files outside of Internet Explorer

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
 
K

Ken Cox [Microsoft MVP]

Are you sending the content as an attachment with a name? That seems to work
for me... it launches Excel.
 
S

Steve C. Orr [MVP, MCSD]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top