<a href> tag to open excel file

7.9k Views Asked by At

I am currently using Visual Studio 2010 and wanted to have a link on my page that opened in a new window a simple excel sheet that is on a local drive.

I have used a simple tag to open this file.

  <a href="S:/BettyTest.xlsx" target="_blank" title="Excel Test">Excel Book Test</a>

This opens the file as requested but it doesn't open this to a new window. I am currently using IE8. When clicking the link, I get the prompt to either open or save the workbook and when I select open, this opens over the web page.

2

There are 2 best solutions below

1
On BEST ANSWER

Your href needs to be different

Something like this

file:///S:/BettyTest.xlsx

1
On

you can use Google Document Viewer to view all files

Here is the Url to view

http://docs.google.com/gview?url=YOUR_FILE_URL

I am not sure about how its working but it will open your file instead of download

Thanks