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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Windows in Toolbar with VBA Code

Status
Not open for further replies.

ajorge

MIS
Mar 20, 2002
18
US
I was wondering if there is any way to dsiable the Windows in Toolbar feature using VBA Code.
 
Function MenuDis(MenuName, EnDis)
In a module put this:
Dim MyBar
Set MyBar = CommandBars(MenuName)
MyBar.Enabled = EnDis
MyBar.Visible = EnDis
End Function

On a form or where you like put this:
Private Sub Form_Close()
MenuDis "MenuMain", False
End Sub
Private Sub Form_Open(Cancel As Integer)
MenuDis "MenuMain", True
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top