Forum Discussion
Links to Sharepoint Document in Excel Opens in Browser
Just to crosscheck both these settings are selected as below right?
Library > Library Settings > Advanced settings > Opening Documents in the Browser > Default open behavior for browser-enabled documents.
Site Settings > Site Collection Administration > Site Collection Features > Open Documents in Client Applications by Default.
Also make sure none of the addons are corrupted. Try to reinstall addons like NameCtrlClass and SharepointDocumentClass.
If none of above work try to repair and reinstall office and let us know.
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?
- domemsgroupJan 26, 2019Copper Contributor
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! :)