Results 1 to 6 of 6

Thread: Hiding Excel

  1. #1

    Thread Starter
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382

    Hiding Excel

    Can someone tell me how to hide the worksheet menu bar.
    I've tried this code:

    VB Code:
    1. application.commandbars("Worksheet menu Bars").Visible = False

    but, it doesn't work. Can someone help me please?!!?


    Thanks in advance,
    Greyskull

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    Something like this (untested) at your own risk (grin) :-

    '---------------------------------------
    Sub untested()
    For Each b In Application.CommandBars
    b.Visible = False
    Next
    End Sub
    '---------------------------------------
    Regards
    BrianB
    -------------------------------

  3. #3

    Thread Starter
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382
    I've already done this by having this code

    VB Code:
    1. Sub OK()
    2. For Each onebar In Application.CommandBars
    3. onebar.Visible = False
    4. Next
    5. End Sub

    But it still doesn't remove it.

    Thanx anyways

  4. #4
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126
    Here is what you are looking for:

    Same question asked just last week - try searching the archives before you post.

    [Highlight=VB]
    Dim Bar As CommandBar
    For Each Bar In Application.CommandBars
    Bar.Enabled = False
    Next
    [\vbcode]
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

  5. #5
    Junior Member Shattered's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    26
    try reading the post before condeming it fiddler.

    The code you've posted doesn't actually work - it seems to be office XP that causes it problems as that code does work with excel prior to that.

    I'm runing office xp with windows xp pro and that code hasn't worked for me since I upgraded.

    - update -

    my bad, just added sp3 for office xp and the code works?
    Last edited by Shattered; Mar 11th, 2004 at 05:28 AM.
    "much to learn you still have"

  6. #6
    Lively Member TheFIDDLER's Avatar
    Join Date
    May 2002
    Location
    here and there and far away
    Posts
    126
    Works for me in Excel 97, and Excel XP (using sp-2)

    It's about using the .enabled property and not the .visible property.

    I was having a long day yesterday - didn't mean to be spitefull. And I did post the same thing just last week.
    -----
    #VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP

    I miss my VIC 20.
    Never should have upgraded to my commodore 64. ...

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