How to Disable Export to Excel Button in SharePoint Online?

Requirement: Disable Export to Excel in SharePoint Online.

How to Disable Export to Excel in SharePoint Online?
A business team wanted to remove the ability to export list data into Excel. How do I disable or hide "Export to excel" button in modern SharePoint Online lists? 
sharepoint online disable export to excel

Option 1: Create a Custom Permission Level without Client Integration Features
The idea is to create a new permission level without "Client integration features" and assign to users to disable export to excel. To create a new permission level, follow these steps:
  • Click on Settings Gear >> Choose "Site Permissions" link.
  • "Advanced permissions settings." >> Click on "Permission Levels" from the ribbon.
  • Select any existing permission level such as Contribute or Read >> Scroll to the bottom of the page >> Click on "Copy Permission level" button
  • Provide a name to your new permission level. E.g. "Read without Client Integration". Under "Site Permissions", uncheck "Use Client Integration Features  -  Use features which launch client applications. Without this permission, users will have to work on documents locally and upload their changes." and click on "Create" button to create the permission level.
    create permission level without Client Integration Features
  • Assign this custom permission level to users and groups who don't need "Export to Excel" option. Make sure the users are not part of any other higher permission groups in the site (Because, SharePoint permissions works in cumulative manner!).
Any user or group with the above permission level won't get the "Export to Excel" button in SharePoint Online modern lists and libraries. (Export to Excel would be disabled in classic experience!). Please note this disables other client integration features as well, such as "Open in File Explorer", "Edit in App", etc.

Option 2: Inject CSS to the Site to Hide Export to Excel Button
Instead of dealing with permissions, The second approach disables the export to excel button from everyone including Site Administrators with the help of CSS. You have to deploy the SPFx application customizer in modern sites and use below CSS to remove export to excel button.
button[name="Export to Excel"] {
      display: none;
}
Refer this post to insert CSS in modern SharePoint Online sites: How to Inject Custom CSS to Modern SharePoint Online Sites?

SharePoint Online: Hide Export to Excel in Classic Experience
If you are using Classic experience, You can edit the page, add a script editor web part and then place this CSS to remove export to excel in SharePoint Online list.
<style type="text/css">
   a[id*='ExportToSpreadsheet'] {
         display:none;
         }
</style>

1 comment:

Please Login and comment to get your questions answered!

Powered by Blogger.