Permanently prevent User to see Formula Bar
You could hide the View CommandBarControl in the Worksheet Main Menu. Use
the following code and set CBnum = 1 and CBctrl = 30004. Use the second set
of code to unhide it.
Hope this helps.
Sub HideCBcontrols()
Dim CB As CommandBar, CBctrl As CommandBarControl
Dim CBnum As Integer, CBname As String
Dim CBctrlNum As Integer
CBnum = InputBox("Enter CommandBar Index No.")
CBctrlNum = InputBox("Enter CommandBarCtrl ID No.")
On Error Resume Next
For Each CBctrl In Application.CommandBars.Item(CBnum).Controls
If CBctrl.ID = CBctrlNum Then
CBctrl.Visible = False
End If
Next
End Sub
Sub ShowCBcontrols()
Dim CB As CommandBar, CBctrl As CommandBarControl
Dim CBnum As Integer, CBname As String
Dim CBctrlNum As Integer
CBnum = InputBox("Enter CommandBar Index No.")
CBctrlNum = InputBox("Enter CommandBarCtrl ID No.")
On Error Resume Next
For Each CBctrl In Application.CommandBars.Item(CBnum).Controls
If CBctrl.ID = CBctrlNum Then
CBctrl.Visible = True
End If
Next
End Sub
"OMER" wrote:
Hola,
I wonder if there is a way to prevent (permanently) a user to activate the
formula bar while a specific worbook is open. I'm able to hide it inside the
openning macro with the following command:
Application.DisplayFormulaBar = False
However, the user can still go to the ribon menu and activate it back.
I want it top remain hidden until the workbook is closed.
Thank you for your help.
OMER
|