Results 1 to 4 of 4

Thread: Excel - Hide Macros Toolbar

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Location
    Australia
    Posts
    2

    Excel - Hide Macros Toolbar

    I have written a file where I do not want other users to access the 'tools - macros' toolbar. Is there some simple code to either hide the 'Worksheet Menu Bar' or at least diable the 'Tools - Macro' function on the 'Worksheet Menu Bar'?

    Help!

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    I don't think you can easily hide the menu bar. In my experience people almost always end up with more problems than they bargained for when messing with standard Office toolbars, but here's how you kill the Macro menu item:

    VB Code:
    1. Application.CommandBars("Tools").Controls("Macro").Delete

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Location
    Australia
    Posts
    2
    Many thanks, more research has revealed the following code

    Dim cbar As CommandBar
    For Each cbar In CommandBars
    If cbar.Enabled And cbar.Type = msoBarTypeNormal Then
    cbar.Visible = False
    End If
    Next cbar
    CommandBars("Worksheet Menu Bar").Enabled = False

    It works well, however, the closing code must return the spread sheet back to normal or all sorts of grief occurs.

    Many thanks again

    GB

  4. #4
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    Ahh, yes. I didn't think of disabling the toolbars.

Posting Permissions

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



Click Here to Expand Forum to Full Width