ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Lock all menu tabs (https://www.excelbanter.com/excel-discussion-misc-queries/144313-lock-all-menu-tabs.html)

Jithu

Lock all menu tabs
 
Hi,

It would be a great help if some can suggest a way to lock or hide all menu
tabs (like select, copy,cut, inser etc) so that the user can use only command
buttons to navigate/perform tasks.

Bob Phillips

Lock all menu tabs
 
Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jithu" wrote in message
...
Hi,

It would be a great help if some can suggest a way to lock or hide all
menu
tabs (like select, copy,cut, inser etc) so that the user can use only
command
buttons to navigate/perform tasks.




Mike H

Lock all menu tabs
 
Tools|options|View and uncheck sheet tabs will hide them

Mike

"Jithu" wrote:

Hi,

It would be a great help if some can suggest a way to lock or hide all menu
tabs (like select, copy,cut, inser etc) so that the user can use only command
buttons to navigate/perform tasks.


Jithu

Lock all menu tabs
 
Thanks Bob......Great Job....

"Bob Phillips" wrote:

Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jithu" wrote in message
...
Hi,

It would be a great help if some can suggest a way to lock or hide all
menu
tabs (like select, copy,cut, inser etc) so that the user can use only
command
buttons to navigate/perform tasks.






All times are GMT +1. The time now is 10:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com