PDA

Click to See Complete Forum and Search --> : Hiding Excel


Greyskull
Mar 9th, 2004, 06:01 AM
Can someone tell me how to hide the worksheet menu bar.
I've tried this code:


application.commandbars("Worksheet menu Bars").Visible = False


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


Thanks in advance,
Greyskull

BrianB
Mar 9th, 2004, 08:53 AM
Something like this (untested) at your own risk (grin) :-

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

Greyskull
Mar 10th, 2004, 06:53 AM
I've already done this by having this code


Sub OK()
For Each onebar In Application.CommandBars
onebar.Visible = False
Next
End Sub


But it still doesn't remove it.

Thanx anyways

TheFIDDLER
Mar 10th, 2004, 09:28 PM
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]

Shattered
Mar 11th, 2004, 04:24 AM
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?

TheFIDDLER
Mar 11th, 2004, 11:16 AM
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.