How to disable the quick acces ribbon through Excel VBA

Benne Gort 1 Reputation point
2021-04-20T13:30:39.137+00:00

I use Excel 2016 installed on a stand-alone desk-top computer
I have written a program for employee info and to register free days / and holydays etc.

How to prevent other people to have acces to the commands on the Ribbon
and the Quick Acces Ribbon, such as OPEN FILE / SAVE FILE / NEW FILE etcetera.

In fact, what I mean is to hide the RIBBON and the QUICK ACCES RIBBON when
the program starts and enable them again when the program is terminated.

Are there specific commands in VBA

Many thanks in advance

B. Gort
The Netherlands

Developer technologies | Visual Basic for Applications
{count} votes

5 answers

Sort by: Most helpful
  1. Viorel 122.6K Reputation points
    2021-04-21T13:42:56.067+00:00

    To handle the Save or SaveAs commands, you can add these lines to your module:

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
       . . .    
    End Sub
    

    To cancel the operation, execute ‘Cancel = True’.

    I think that you can let the user to freely use New and Open operations to work with any other workbooks. Blocking Excel globally looks too severe.

    But maybe the protection features of Excel can be used too. See the “Protect” group of “Review” tab.

    0 comments No comments

  2. Benne Gort 1 Reputation point
    2021-04-21T14:07:32.7+00:00

    Dear Viorel-1

    The meaning of it is that the user cannot execute other Excel files because it is a
    very large program and very big (more then 800 macro's and counting)

    And because of the amount of information on the worksheet I need as much space
    as possible, so every line is more info visible in the sheet
    (I do hide the formula bar and the row and column indicators)

    I hope this info is sufficient

    Many thanks in advance

    B. Gort
    The Netherlands

    0 comments No comments

  3. Bill Bell 101 Reputation points
    2021-04-23T23:28:39.08+00:00

    Check this post out

    I used the Custom UI Editor to this. Here is the post I used to understand how to do it.

    0 comments No comments

  4. Benne Gort 1 Reputation point
    2021-04-27T15:04:09.527+00:00

    Dear BillBell-6414

    Thanks for your answer, but this is about customizing the ribbons.

    What I want is to HIDE the ribbons so that users cannot us them
    and only can use the menus provided in the Excel-program

    Is that possile?

    Many thanks in advance

    Benne Gort

    0 comments No comments

  5. Bill Bell 101 Reputation points
    2021-04-27T18:57:44.647+00:00

    The best description of how to do this is in a book called Automated Data Analysis Using Excel (Chapman & Hall/CRC Data Mining and Knowledge Discovery Series) 2nd Edition. It has a whole chapter on the ribbon including the QAT. It is an excellent book on Excel and data analysis. I got it last year.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.