6

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?
    – jlouzado
    Jun 27, 2022 at 10:07

5 Answers 5

6

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/

1
  • 1
    your href is missing an '=' Apr 5, 2021 at 6:25
0

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

3
  • 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.
    – Manoj
    Dec 13, 2011 at 13:26
  • It will if you change the sharing permissions to allow it. Dec 13, 2011 at 15:06
  • @Charles Williams your link has been expired. Can you provide a new one please?
    – valijon
    Apr 13, 2018 at 6:39
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;
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
  • 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.
    – jlouzado
    Jun 27, 2022 at 10:06
  • 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.
    – chenks
    Aug 24, 2022 at 11:32
-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
  • this suggestion will fail if file is not public
    – Ashutosh
    May 25 at 9:54

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.