+ Reply to Thread
Results 1 to 17 of 17

Hide menu bar of sheet excel

  1. #1
    Registered User
    Join Date
    07-12-2015
    Location
    madagascar
    MS-Off Ver
    office2010
    Posts
    52

    Hide menu bar of sheet excel

    Hello EXCEL HELP
    Hello every one
    Will be a very great pleasure to find who can help me to solve my problem
    Please I want to know how to hide menu bar in excel sheets and I only display the menu bar with an code
    Please see this picture
    Thank you..thank you very much in advance for help me
    Cordially
    MADA BLACK
    1.png
    Last edited by MADA BLACK; 07-29-2015 at 07:28 AM.

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide menu bar of sheet excel

    Try this
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Hide menu bar of sheet excel

    One of the most exciting parts of Excel is perhaps its ability to be customized to show the end user something quite different. For example, many build their own custom toolbar and distribute them with their Spreadsheet. However, the one question that come up time and time again is 'how can I hide all of Excel's toolbars and show only mine when they are using my spreadsheet?' There are many ways to do this with some being extremely complicated (un-necessarily) through to totally flawed code which leaves the user Starting at a blank screen. The golden rule when/if changing any part of Excel is to make sure it all goes back to how it was when they are not in our specific spreadsheet. In other words, restore the users settings!

    Attach Your Toolbar to the Workbook

    For this example I will assume you have a custom toolbar called "MyToolbar" and you wish to hide ALL of Excel's built in toolbars and show only "MyToolbar". Before we do so though, it is VITAL that you attach your custom toolbar to the Workbook that will be using it. This will also stop users from being able to make changes stick and ensure you do not get the "The Macro <macro name> could not be found", or where clicking a toolbar button opening up the Workbook so it can run the macro being clicked. To attach the custom toolbar and over-come these issues, follow the steps below;

    1) Open the Workbook that should have the custom toolbar.

    2) Right click on any grey unused part of any toolbar and choose "Customize".

    3) On the "Toolbars" page check "MyToolbar" (or the applicable name) so it becomes visible.

    4) Click "Attach" and then from the "Attach Toolbar" dialog select your toolbar and then click "Copy".

    5) Click "Ok" then "Cancel" and it's done!

    You should now be aware that, ANY changes made to your custom toolbar will not stick (between closing and re-opening the Workbook it's attached to) unless you first (before any changes) go back to the "Attach Toolbar" dialog and select your toolbar, this time from the right side ("Toolbars in workbook") and then "Delete". Now make any changes needed and then follow steps 1 to 5 again.

    Coding the Toolbar Show and Restore

    The 2 macros below are what can be used to show your toolbar, remove all native toolbars and most importantly restore them back when done;



    Please Login or Register  to view this content.






    Please Login or Register  to view this content.
    The best way to enure these 2 macros are run at the correct time, is to place a Run Statement in the Workbook_Activate, Workbook_Deactivate procedures of the Workbook Object (ThisWorkbook). To get there quickly, right click on the Excel icon top left next to "File" on the Worksheet Menu Bar and select "View Code". In here place the code below;


    Please Login or Register  to view this content.


    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: Hide menu bar of sheet excel

    @Yasser - When RemoveToolbars is run, it does hide everything as required, however, when you minimize the file and maximize it again, it restores all the hidden toolbars..
    Cheers!
    Deep Dave

  5. #5
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Hide menu bar of sheet excel

    Hi -

    try this one the way I look at the screen shot from MADA BLACK

    Please Login or Register  to view this content.
    event

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide menu bar of sheet excel

    @NeedForExcel
    Try this in workbook_module
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-12-2015
    Location
    madagascar
    MS-Off Ver
    office2010
    Posts
    52

    Re: Hide menu bar of sheet excel

    Hello every one
    Thank you Yasserkhalil
    Thank you Parth007
    Thank you NeedForExcel
    Thank you event21
    Thank you for your best answers
    I tried one by one
    Cordially
    MADA BLACK

  8. #8
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: Hide menu bar of sheet excel

    @event21's Code works well..

    This code wont let the workbook minimize.

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide menu bar of sheet excel

    @NeedForExcel
    The workbook is minmized normally and when mazimized it executes "RemoveToolbars" macro

    You're welcome MADA BLACK . Thanks for the feedback
    Regards
    Last edited by YasserKhalil; 07-29-2015 at 08:15 AM.

  10. #10
    Registered User
    Join Date
    07-12-2015
    Location
    madagascar
    MS-Off Ver
    office2010
    Posts
    52

    Re: Hide menu bar of sheet excel

    Hello every one
    Please I am beginner in vba excel
    where I have to put these code
    I tried to put them in a module, but unfortunately it not walked
    Thank you in advance for answers
    Cordially
    MADA BLACK
    2.png

  11. #11
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Hide menu bar of sheet excel

    Hi -

    Put this one on that module;
    Please Login or Register  to view this content.
    event

  12. #12
    Registered User
    Join Date
    07-12-2015
    Location
    madagascar
    MS-Off Ver
    office2010
    Posts
    52

    Re: Hide menu bar of sheet excel

    Hiiii event21
    Thank you for answer
    Your code works very well
    Simple and effective code
    I have just one final question
    What if I want to display the menu bar ??
    Thank you in advance
    Cordially
    MADA BLACK
    Thank-you2.jpg

  13. #13
    Registered User
    Join Date
    07-12-2015
    Location
    madagascar
    MS-Off Ver
    office2010
    Posts
    52

    Re: Hide menu bar of sheet excel

    Hello EXCEL HELP
    Hello every one
    I put this code for hide menu bar of sheet excel..it work very well but :
    I have just one final question
    What if I want to display the menu bar ??
    code :
    Sub Auto_Open()
    Application.ExecuteExcel4Macro "Show.ToolBar(""Ribbon"",false)"
    End Sub

    Thank you in advance
    Cordially
    MADA BLACK

  14. #14
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Hide menu bar of sheet excel

    Replace false with true
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    07-12-2015
    Location
    madagascar
    MS-Off Ver
    office2010
    Posts
    52

    Re: Hide menu bar of sheet excel

    Quote Originally Posted by YasserKhalil View Post
    Replace false with true
    Please Login or Register  to view this content.
    Hiii Yasserkhalil
    Thank you very much
    Cordially
    MADA
    Thank-you1.jpg

  16. #16
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Hide menu bar of sheet excel

    Hi -

    Both codes shows in my post #5, it is a matter of where you want to put the codes.

    event

  17. #17
    Registered User
    Join Date
    07-12-2015
    Location
    madagascar
    MS-Off Ver
    office2010
    Posts
    52

    Re: Hide menu bar of sheet excel

    Hiiii event21
    Yes you are right
    I do not understand well in vba excel
    Thank you for help and for your precious time to solve my problem
    Thank you for all
    Cordially
    MADA
    thank you.jpg

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [VBA CODE] Excel - Hide Ribbon but leave File menu
    By cityinbetween in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2014, 09:55 PM
  2. Hide file menu ribbon excel 2010
    By DavidMorrison in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2010, 05:19 PM
  3. Replies: 2
    Last Post: 01-13-2010, 09:31 PM
  4. want to add excel sheet without menu on vb form
    By amy's in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2006, 04:15 AM
  5. [SOLVED] Hide Excel Menu From Screen
    By r wilcox in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2005, 10:05 AM
  6. Replies: 5
    Last Post: 02-08-2005, 01:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1