Application.CommandBars Help

G

gti_jobert

Hello,

I have the following code;


Code:
--------------------

Private Sub Workbook_Open()
Sheets("Menu").Activate
Range("C7").Select

If Application.UserName = "xxxxxx" Then
ActiveWindow.DisplayWorkbookTabs = False
For Each bar In Application.CommandBars
bar.Enabled = True
Next
With Application
.DisplayFormulaBar = False
End With
End If
End Sub

--------------------


The code above seems to work fine, it removes all command bars from the
excel application.....but when I activate other sheets a grey box
(toolbar box - when I right-click it promts 'customize') appears at the
top of my excel sheets that covers the top of the vertical scroll bar
and can look untidy - why does this appear after selecting other
sheets, and how do I get rid of it?

TIA
 
J

Jim Thomlinson

Does that code hide the command bars? I see bar.eneabled = True which enables
the bar, but nothing to hide the bar... (bar.visible = false). Not to mention
how do you get the original bars back at the end with this code since you do
not store the bar indecies or names anywhere???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top