How to Disable Open in Browser Option in SharePoint
Question details
Users want to prevent documents from opening in the web browser by default in SharePoint, often to avoid functionality issues with complex files like macro-enabled Excel spreadsheets.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Configuring SharePoint document library settings to force files to open natively in desktop applications rather than in the web browser.
- Observed behavior
- SharePoint allows administrators to set a default client application for opening files, but it does not provide a built-in feature to completely remove or disable the 'Open in browser' context menu option.
Ensure you have Site Owner or Administrator permissions for the SharePoint site, as modifying advanced library settings requires elevated access.
Set the Default Open Behavior to Client Application
While you cannot completely remove the 'Open in browser' button, you can configure the document library to prioritize opening files in the desktop app by default.
This is the official and most stable method to ensure users interact with desktop applications instead of the limited browser-based viewer.
Navigate to your SharePoint Document Library, click the 'Settings' gear icon in the top right corner, and select 'Library settings'.
Click on 'More library settings' to open the classic settings page, then choose 'Advanced settings'.
Scroll down to the 'Opening Document in the Browser' section and select the 'Open in the client application' radio button.
Click 'OK' at the bottom of the page to apply the new default opening behavior for all users.

Hide the Option Using Custom Code (Advanced Workaround)
For organizations requiring strict enforcement, custom CSS or JavaScript can be used to visually hide the browser option, though this is not officially supported.
Handle Complex Documents Locally with WPS Office
Since SharePoint limits your ability to disable browser viewing for complex files like macro-enabled spreadsheets, the best practice is to download these files and edit them locally. WPS Office is a powerful, free alternative that handles complex document formatting and local processing with ease.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the setup file and follow the straightforward on-screen instructions to complete the installation.
- 3. Edit Files Locally: Download your files from SharePoint and open them directly in WPS Office to utilize full desktop editing features without browser limitations.

Frequently Asked Questions
Why do Excel files with macros have issues in the SharePoint browser view?
Excel for the Web does not support running VBA macros. To execute or interact with macro functionality, the spreadsheet must be opened in a desktop client application that supports local script execution.
Can I disable 'Open in browser' for a specific file type only?
No, SharePoint's advanced library settings apply the default opening behavior to all supported document types in that library uniformly. You cannot isolate the setting to affect only Excel or Word files.
Will changing the default open behavior affect users without desktop Office apps?
Yes. If a user does not have a compatible desktop application installed, SharePoint will attempt to fall back and open the file in the browser anyway, or prompt the user to download the file locally.




