Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding toolbars in excel

Status
Not open for further replies.

striveforexcelence

Technical User
Oct 5, 2005
34
US
I have an excel application that it is unnecessary for the end user to use any toolbars. they need only enter numbers in appropriate places. I have hidden all of the toolbars and the column rows and headings and sheet tabs. Is there a way to also hide the file, edit, view, insert, format, tools etc. menu items? Ideally I would like these to be unavaiable to the user as well.????

Thank you for any suggestions. ( I know it seems odd but the end user really does not need these and it helps to preserve formatting, etc. as well. )
 


Hi,

I believe that there must be at lease one menu bar visible. Create your own menu, make it visible and then hide the stock menu.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Hi striveforexcelence,

You cannot make the Menu Bar invisible. You can, however, disable it in code to suppress it showing ...
Code:
CommandBars("Worksheet Menu Bar").Enabled = False

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
I tried this code but it gets compile errors. I have tried to play with it but nothing I do seems to work. The latest I tried was


Private Sub Worksheet_Open()

CommandBars("Worksheet Menu Bar").Enabled = False

End Sub


I also tried other things like naming the worksheet etc. Any suggestions?


 
Hi striveforexcelence,

I don't know about Worksheet_Open or where you're trying to run this but it ought to work. Try using
Code:
[b]Application[/b].CommandBars("Worksheet Menu Bar").Enabled = False

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
I researched this a bit and apparenly you were correct that you don't need "application" but you can use it i guess. My problem is this: where do you declare this? I have tried many places such as this workbook, sheet, etc and each time I receive a compiler error "invalid outside procedure". I'm sorry if I am overlooking the obvious I am not familiar with application properties or objects.
 
Hi striveforexcelence,

This is an Application setting which you can't save with the workbook. As you only want it for a particular workbook you need to put code in events in the workbook to disable and reenable it - I would suggest activate and deactivate.

In the ThisWorkbook module add this code:
Code:
Private Sub Workbook_Activate()
    Application.CommandBars("Worksheet Menu Bar").Enabled = False
End Sub
Private Sub Workbook_deActivate()
    Application.CommandBars("Worksheet Menu Bar").Enabled = True
End Sub



Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top