none
How to disable the Export to Excel button in the ribbon in a custom list

    Question

  • Hi,

    How to disable the Export to Excel button in the ribbon in a custom list for all the users?

    Is there any option to hide using javascript - CSOM?

    I want to hide it for all the users including owners.

    Is there any option?

    Thanks.

    Wednesday, April 23, 2014 12:16 PM

Answers

  • Hi Sriram,

    According to your description, my understanding is that you want to hide the Export to Excel button in a custom list.

    You can add the following code into a text file, then upload the file into a library. Then go to the custom list page, edit the page, add a Content Edit web part, and edit the web part, then link the text file to the content link.

    <style type="text/css">
    
    a[id*='ExportToSpreadsheet']
    {  display:none;}
    
    </style>

    I hope this helps.

    Thanks,

    Wendy


    Wendy Li
    TechNet Community Support

    Monday, May 05, 2014 9:28 AM
    Moderator

All replies

  • You can do it via a no-code Sandboxed solution;

    http://the-north.com/sharepoint/post/Hiding-Multiple-Ribbon-Buttons


    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

    Wednesday, April 23, 2014 12:37 PM
  • No i want to do it from client side.

    I am having 2 list web parts in a page.

    For the 1st one i need export to excel. second one not needed.

    On the button click event i am changing the webparts(show/hide)

    i want to do the same for  export to excel control as well.

    Using the developer tool, found the id of the link - Ribbon.List.Actions.ExportToSpreadsheet-Large

    Let me know how to and when to hide the option.

    Wednesday, April 23, 2014 12:47 PM
  • If you know its id, try inserting additional CSS similar to the following:

    #Ribbon.List.Actions.ExportToSpreadsheet-Large{

    display:none !important;

    }


    Nikolas Charlebois-Laprade Microsoft Certified Professional & Software Engineer http://nikcharlebois.com

    Wednesday, April 23, 2014 12:52 PM
  • Yes tried this, didnt work.

    As I had added 2 wepparts in a page, the ribbin is not showing up by default.

    We need to select a list item to show up the Ribbon.

    we need to call the script after selecting the list item.

    Please let me know how to achieve.

    Wednesday, April 23, 2014 1:08 PM
  • Hi Sriram,

    According to your description, my understanding is that you want to hide the Export to Excel button in a custom list.

    You can add the following code into a text file, then upload the file into a library. Then go to the custom list page, edit the page, add a Content Edit web part, and edit the web part, then link the text file to the content link.

    <style type="text/css">
    
    a[id*='ExportToSpreadsheet']
    {  display:none;}
    
    </style>

    I hope this helps.

    Thanks,

    Wendy


    Wendy Li
    TechNet Community Support

    Monday, May 05, 2014 9:28 AM
    Moderator
  • Thanks Script works.
    Tuesday, May 13, 2014 3:15 PM
  • Yes it works, thanks Wendy.
    Wednesday, May 14, 2014 12:35 PM