8

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.?

1
  • could you share more context please? is it about opening an excel-editing environment for changes to be made or a view-only experience? Commented Jun 27, 2022 at 10:07

5 Answers 5

9

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>. http://officewebviewer.com/

Sign up to request clarification or add additional context in comments.

Comments

0

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

3 Comments

but when we use skydrive, it will not allow us to interact with excel-sheet, like i have two columns where i'm inserting two integer number and in third column it will calculate the sum of it, skydrive want allow us to insert any value in excel sheet.
It will if you change the sharing permissions to allow it.
@Charles Williams your link has been expired. Can you provide a new one please?
0

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 Html:

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

JS:

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

Comments

0

I am not a programmer, I also wanted to open the excel file in web browser.

I found a way to open the excel file in browser , just we need to open existing or new file and while saving save it to one of the web format(.mht,.mhtml,.htm or .html) by this way the file becomes non-editable and can only be viewed.

The advantage is that it executes more faster than excel, and disadvantages are many as we cannot edit the file.

Hope this answer is helpful!

2 Comments

honestly, if OP is the programmer of an application and they want to give users an in-browser table-viewing experience this is not a bad reply. Upload excel, convert to a web-format and then allow people to view.
i am trying this method right now. saved the Excel as mht file, however whenever i open it in either Edge or Chrome the page is just blank (firefox also doesn't seem to like opening these files). which browser are you using to support opening these correctly? from a brief search it looks like no chromium based broswers have support for opening these natively, but need to be put into IE mode to do it.
-1

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

1 Comment

this suggestion will fail if file is not public

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.