Forum Discussion
Links to Sharepoint Document in Excel Opens in Browser
Thank you very much for your reply and suggestions.
I have done everything suggested. The settings were already as required. However, opening the documents from the links in Excel still attempts to open them in the browser rather than with the native application.
Is there anything else I can try?
Hi Jon,
Hi got to the bottom of this.. after many hours and then Microsoft support.
You will need to customize the link in order for it to open in the local program.
For instance, this link will open a document called Test.xlsx in a web browser:
However, if you browse to the document library, and then copy and customize the address and add the filename, you could make the link look like this:
https://contoso.sharepoint.com/sites/Test/Shared%20Documents/Test.xlsx
This document will now open in Excel the program rather the web browser.
You will need to make sure their default web browser is logged into Office 365, and that the prompt to allow the document to open in the program is accepted and you can save the choice. It may still prompt to click ok in the future when clicking a link that defaults to open in the program.
Also, you will need to make sure that in Library Settings for the site, and in Advanced Settings, that you have set the default open behavior for browser-enabled documents to open in the client application.
If you want to avoid the user being prompted to open the Excel program when using the customized link, you can use Excel URI schemes to modify the custom link.
This website contains information on URI schemes with MS Office applications.
Office URI Schemes
https://docs.microsoft.com/en-us/office/client-developer/office-uri-schemes
You will need to use the customized link as mentioned already with the addition of the URI scheme to open the Excel program without prompting when using a link from within an office application, or if you want to create a regular link you can place on a users desktop or in my documents that links to the SharePoint file.
To create a hyperlink that links to an Excel document in SharePoint online, and to open that document in Excel with editing enabled without being prompted, this would be the format:
ms-excel:ofe|u|https://contoso.sharepoint.com/sites/Test/Shared%20Documents/Test.xlsx
You would then need to right click on the cell and click Link and set it to be a hyper link with the address using the same exact text with the entire contents of the link included in the address.
The URI schemes article describes how to setup links for Excel and other MS Office programs, and the options that are available to open the documents such as in view only or edit mode.
- AthenianRazakMar 08, 2019Brass Contributor
Jon - that's impressive detective work, but Microsoft, are you kidding? Why do those settings exist in Sharepoint Administration if they don't actually work? Is the ridiculous kluge that Jon had to piece together really the only way to actually force O365 to open file links in their native applications instead of a browser? This behaviour completely flummoxes our users, especially if they don't happen to be logged into O365 in the browser, in which case the "Open in..." command doesn't appear in the menu bar. No standard user is going to go to the lengths (or know how to go to the lengths) Jon describes simply to get O365 to do what it should by rights do by default (and used to do, until somebody decided to change it a few months ago).
- 80Mark80Apr 19, 2019Copper Contributor
domemsgroupThanks for encouraging me to look at this again. I too tried making the default behavior to open Excel in the app not the browser and the steps did not always work for me. In particular, I have a dashboard page where staff expect to click on the document to open it in the app. I trained them to click on "Open in Excel" from the drop down or open in Excel from the browser Excel, but I kept getting calls that the macro wouldn't work (due to the file being open in the browser).
I don't want to go in and create the links as you described, so for these sorts of pages I add jQuery and a reference to a script file that removes the SharePoint behavior of opening the file in the browser by removing the onclick attribute of the hyperlink tag.
<script type="text/javascript">
// tested with jQuery 1.11.3
$(document).ready(function() {
$("a[onclick^='CoreInvoke']").removeAttr('onclick');
}); //document ready
</script>This does the trick, at least in Firefox. Also, for this page I didn't care if all of the onclick events were removed.
- jan-zidekJun 03, 2019Copper Contributor
Thanks a lot - but why so long a description? All I actually needed to use from your answer is this ms-excel:ofe|u| prefix at the beginning. And the magic happens! :)
- BamsefarSep 26, 2019Copper Contributor
domemsgroup
Really interesting reading - I first though I was alone in this.
I'm trying to open a Word document, saved in a SharePoint site, with Excel.The "ms-word:ofe|u|" prefix doesn't work and your instruction about setting default browser actions cannot be found in Excel's options.
Is it possible to obtain a little helping push to make it work?
It's Office 2016 products.
- domemsgroupSep 26, 2019Copper Contributor
You need to copy the file path from the file
then the link would be
"ms-word:ofe|u|" your file path then remove ?web=1 from the end of the pasted text.
msword:ofe|u|https://yourfilepath.docx
remove?web=1
- AthenianRazakSep 26, 2019Brass Contributor
domemsgroupThis doesn't work because there's no app registered by default in Windows to handle this link as you've constructed it, and none are offered by Windows. Beyond that, this is a kluge workaround and not a solution to the real problem. No typical user is going to edit hyperlinks - this platform is for people doing real everyday work, not techheads who are willing to code their way around Microsoft obstacles.
- GuiPitaOct 21, 2020Copper ContributorThe URI scheme as a prefix worked just fine. Thanks for posting it!
- job1986May 14, 2021Copper ContributorHello,
I’ve come across this thread whilst trying to solve a similar problem and wondered if you can help.
I have an excel file that I want multiple users to edit at once so it needs to open in a browser by default. Some of the users are not necessarily that tech savvy so I don’t really want to accompany it with instructions of how to change their settings to make this happen.
From what I can gather, in the url, I need “action=default”. Will this do what I want or if they are currently set up with the default being to open in the desktop app, will it do that instead? If so, do you know how I can get it to do what I want?
To complicate matters a little further, it has a macro that only a small number of users will very occasionally use - I can tell them to then open it in the desktop app after it has opened in a browser but really I then want it opening in their browser next time they use it.
Thanks for any thoughts you have!- 80Mark80May 14, 2021Copper Contributor
job1986 I think that if there is a macro involved that using Excel in a browser is a not a good long term solution. If you are using Office 365, it is possible to have multiple people editing the file at once, what Microsoft calls co-authoring and here, using OneDrive. I've trained users to select "Open in the Desktop App" from the menu, sometimes available in SharePoint or to open the desktop app from the browser, but I've had more luck recently having users sync the folder that the Excel file is in with OneDrive. Then from Windows file explorer the user opens the file.
I haven't tried co-authoring this way, but I think that it should work if the User's OneDrive's settings for Office file collaboration has the "Use Office applications to sync Office files that I open" checked (Microsoft help). It may also require auto-save to the cloud to be enabled.