Results 1 to 9 of 9

Thread: Disable Power Pivot Menu

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    I tried it before the ribbonX path.

    It worked well but has an unintended consequence - the disabling of the ribbon in the activate and deactivate method also cleared the clipboard.

    So lets say that you send an Excel file "Book1" to users. this Book1 file has macros in the activate and deactivate method:

    ""Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"/(""Ribbon"",True)"


    The user opens book1 and book2. When they move between them Book1 doesn't have a ribbon, book2 does have.

    However, when they want to copy data from book1 to book2: they select the data in book1 and crtl-c, then they move to book2 and try to paste, the "paste" is grayed out.

    after long research I found out that the deactivate procedure in book1 (that was returning the ribbon when moving to book2) actually has some built in effect that clears the clipboard.

    also - I am not thrilled about this path (VBA activate/deactivate) because I am afraid if the user laptop suddenly crashes, out of battery, windows failure.... the user Excel will remember the "no ribbon" state and affect their excel behavior.


    I was thinking about it and maybe for my solution this workaround will do it. I tried and it did what I want but I am not sure yet if there are any side effects: clear the entire ribbon, and then rebuilt their menu items. It will only affect this one document.

    <ribbon startFromScratch="true">
     <tabs>
     <tab idMso="TabHome" visible="true"></tab>
     <tab idMso="TabInsert" visible="true"></tab>
     <tab idMso="TabPageLayoutExcel" visible="true"></tab>
    ....
    Last edited by Aussiebear; 04-18-2023 at 01:52 PM. Reason: Added code tags to supplied code (Again...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •