Home » excel » html – How to open Excel file in browser, not in excel application

html – How to open Excel file in browser, not in excel application

Posted by: admin March 9, 2020 Leave a comment


I want open Ms-Excel file to open in browser only,
i have written following code

<a href="file.xls">file</a>

but when i’m clicking that link, it always popups a dialog box for open and save, when i open the file opens in Ms-excel not in browser.

Is there any way to open excel file in browser only.?

How to&Answers:

add this slug before your link http://view.officeapps.live.com/op/view.aspx?src=. Exactly like this <a href"http://view.officeapps.live.com/op/view.aspx?src=file.xls">show file</a>.


Yes you can do this using SkyDrive: see http://www.excelmashup.com/Content/GettingStarted.html


Upload it to Google Drive (what used to be Google Docs). Open the document, click on Share, and then link to that address.


If you want to open excel with simple steps and no extra code then go for this. Ref >> https://products.office.com/en-IN/office-online/view-office-documents-online?legRedir=true&CorrelationId=e5efa806-45b2-4a32-8801-c1f5818b1e2c. the code for that is as below.
this you can use for Docx file view as well.Ref Image

<a style="color:blue;display:inline; " href="{{Newdocument_Path}}" target="_blank">{{DocumentName}}</a>


var Newdocument_Path = "https://view.officeapps.live.com/op/view.aspx?src=" + your Excell filepath;