PDA

View Full Version : how to hide excel toolbars from macro enabled file



kcscdf
03-23-2009, 11:00 PM
Hi,

Anyone knows how to hide excel toolbars from users? :hi:

Thanks!

GTO
03-23-2009, 11:24 PM
Greetings,

You might want to take a gander at: http://www.vbaexpress.com/forum/showthread.php?t=25527&highlight=commandbar%3B+toolbar

Hope this helps,

Mark

Bob Phillips
03-24-2009, 03:24 AM
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