+ Reply to Thread
Results 1 to 4 of 4

Hide And Un-hide Excel Toolbars

  1. #1
    Registered User
    Join Date
    01-21-2004
    Posts
    21

    Hide And Un-hide Excel Toolbars

    Hi everybody,

    Is there any code to hide all toolbars when opening the workbook and unhide them when closing the workbook,

    I have one code for that purpose, but the problem with it is that I have to mention all toolbars names in the code to hide or unhide them, and when any toolbar is not mentioned in the code, it will not be hidden or unhidden.

    I hope that my question is clear for all,

    Thankyou

  2. #2
    DM Unseen
    Guest

    Re: Hide And Un-hide Excel Toolbars

    Sub showhide(bHide As Boolean)
    Dim cmb As CommandBar
    Static col As New Collection

    If bHide Then
    For Each cmb In Application.CommandBars
    If cmb.Type = msoBarTypeMenuBar Or cmb.Type = msoBarTypeNormal Then
    If cmb.Visible Then
    cmb.Visible = False
    cmb.Enabled = False
    col.Add cmb, cmb.Name
    End If
    End If
    Next cmb
    Else
    For Each cmb In col
    cmb.Visible = True
    cmb.Enabled = True
    Next cmb
    Set col = Nothing
    End If


    End Sub

    DM Unseen


  3. #3
    Registered User
    Join Date
    01-21-2004
    Posts
    21
    Hi,

    Thank you so much for ur reply,

    I tried to install the code in a workbook, but It didn't work >> so, I would like u please to put it in a workbook and attach it.

    Thanx,

  4. #4
    DM Unseen
    Guest

    Re: Hide And Un-hide Excel Toolbars

    Compile error?

    Pls mail me so I have your email address

    DM Unseen


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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