Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with - J.Walkenbachs code
Hi all, I got the code from J. Walkenbachs book and it works great, but
it does not hide the menu bar, could somebody tell my how i would modify it to hide the menu bar as well ?? --------------------------------------------------------------------- Sub HideAllToolbars() Dim TB As CommandBar Dim TBNum As Integer Dim TBSheet As Worksheet Set TBSheet = Workbooks("Recon_Master.xls").Worksheets("TBSheet" ) Application.ScreenUpdating = False ' clear the sheet TBSheet.Cells.Clear 'Hide all visable toolbars and store their names TBNum = 0 For Each TB In CommandBars If TB.Type = msoBarTypeNormal Then If TB.Visible Then TBNum = TBNum + 1 TB.Visible = False TBSheet.Cells(TBNum, 1) = TB.Name End If End If Next TB Application.ScreenUpdating = True addToolbar End Sub ------------------------------------------------------------------------ - Sub restoreToolbars() Dim TBSheet As Worksheet Dim cell As Range Set TBSheet = Workbooks("Recon_Master.xls").Worksheets("TBSheet" ) Application.ScreenUpdating = False 'unhide the previousely displayed toolbars On Error Resume Next For Each cell In TBSheet.Range("A:A") _ .SpecialCells(xlCellTypeConstants) CommandBars(cell.Value).Visible = True Next cell Application.ScreenUpdating = True End Sub Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with - J.Walkenbachs code
application.Commandbars("Worksheet Menu Bar").Enabled = False
-- Regards, Tom Ogilvy "Tempy" wrote in message ... Hi all, I got the code from J. Walkenbachs book and it works great, but it does not hide the menu bar, could somebody tell my how i would modify it to hide the menu bar as well ?? --------------------------------------------------------------------- Sub HideAllToolbars() Dim TB As CommandBar Dim TBNum As Integer Dim TBSheet As Worksheet Set TBSheet = Workbooks("Recon_Master.xls").Worksheets("TBSheet" ) Application.ScreenUpdating = False ' clear the sheet TBSheet.Cells.Clear 'Hide all visable toolbars and store their names TBNum = 0 For Each TB In CommandBars If TB.Type = msoBarTypeNormal Then If TB.Visible Then TBNum = TBNum + 1 TB.Visible = False TBSheet.Cells(TBNum, 1) = TB.Name End If End If Next TB Application.ScreenUpdating = True addToolbar End Sub ------------------------------------------------------------------------ - Sub restoreToolbars() Dim TBSheet As Worksheet Dim cell As Range Set TBSheet = Workbooks("Recon_Master.xls").Worksheets("TBSheet" ) Application.ScreenUpdating = False 'unhide the previousely displayed toolbars On Error Resume Next For Each cell In TBSheet.Range("A:A") _ .SpecialCells(xlCellTypeConstants) CommandBars(cell.Value).Visible = True Next cell Application.ScreenUpdating = True End Sub Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with - J.Walkenbachs code
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
run code on opening workbook and apply code to certain sheets | Excel Programming | |||
stubborn Excel crash when editing code with code, one solution | Excel Programming | |||
Chart question - Walkenbachs book | Excel Programming |