Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: deactivating menus

  1. #11
    Board Regular
    Join Date
    Apr 2002
    Posts
    765
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Cheers Ts Tom
    The modification worked a dream for the standard and Formatting toolbars
    but trying to hide either the "Worksheet Menu Bar", "Workbook tabs" or "Formula Bar"
    resulted in;

    Run-time error '2147467259 (80004005)':
    Method 'visible' of object 'CommandBar' failed

    Maybe I should detail my overall objectives as you might feel theres a better way of achieving them.

    I have a simple single sheet workbook that I want users to simply enter data into but want to prevent them from making any changes to its layout format etc etc. and of course, without the hide "Worksheet Menu Bar" working they would simply right click and re-open it.

    My one concern is that if indeed the hide "Worksheet Menu Bar", "Workbook tabs" had worked how could I then access the VB code to re-instate the toolbars, and make changes before re-hiding them for end user use.

  2. #12
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    Maybe replace the Visible with
    Enabled instead.
    Can be used in combination as well.
    I think, in this case, Enabled = False
    will make 'em invisible anyway...

    Private Sub Workbook_Activate()
    Application.CommandBars("Standard").Enabled = False
    End Sub

    Private Sub Workbook_Deactivate()
    Application.CommandBars("Standard").Enabled = True
    End Sub

    The ALT-F11 combination will bring
    up your VBA editor without the need
    for a bar.

    I usually only hide the bars for viewing
    space. Protection seems to work well
    enough without hiding things.
    But you know what you are doing and I
    do not.

  3. #13
    Board Regular
    Join Date
    Apr 2002
    Posts
    765
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Tom
    That worked great for the "Worksheet Menu Bar" but didn't work for the "Formula Bar" it does however solve my problem in this case.

    I would like to have used protection to solve my needs but I am using Data-form to have the data entered and this seems to block creating new entries, unless you know a way round it.



    [ This Message was edited by: Peter100 on 2002-04-24 05:44 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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