LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Hiding Excel Menus

I have the following code to hide Toolbars - and have been trying to
develop a parallel to hide menus. This would keep me from having to
idnetify
each one through a line like: CommandBars(1).Controls("xxxx").Visible
= False, but I can't seem to get it to work. In particular, I don't
know what the type is (I can tell its # 10 what ever that is) and I
don't seem to be able to assign the name (e.g. CBSheet.Cells(CBNum,1)
= CB.Name. See below.

Any thoughts?

Sub
Dim TB As CommandBar
Dim TBNum As Integer
Dim TBSheet As Worksheet
Set TBSheet = Sheets("TBSheet")
Application.ScreenUpdating = False
TBSheet.Cells.Clear
TBNum = 0
For Each TB in CommandBars
If TB.Type = msoBarTypeNormal Then
If TB.Visibile Then
TBNum = TBNum + 1
TB.Visible = False
TBSheet.Cells(TBNum,1) = TB.Name
End If
End If
Next TB
' Add back items desired
Application.CommandBars("Visual Basic").Visible = True
Application.ScreenUpdating = True
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub-menus of main menus for Excel 2007 Eleanor Peppard New Users to Excel 1 March 16th 10 04:12 PM
qn on counting in drop down menus and protecting/hiding specific worksheets qiong Excel Worksheet Functions 7 July 6th 07 10:30 PM
Office Button Customization - Hiding Menus - Excel 2007 marcnz Excel Discussion (Misc queries) 1 January 25th 07 03:16 PM
New Menus - attaching but menus are reset Greegan Excel Worksheet Functions 0 November 5th 05 03:19 PM
Overriding Actions of Excel DropDown Menus and Poup Menus Von Shean Excel Programming 2 February 3rd 04 06:43 AM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"