Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Changing Toolbar and Menu Items

I would appreciate if someone could help with the VBA code required to do
the following:
1) Hide all toolbars
2) In the menu display only the following: FILE (Save, Save as, Close,
Exit), TOOLS (Protection, Protect/Unprotect Worksheet),
3) I intend to reset before close to revert back to default

Thanks a lot

Maria .


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Changing Toolbar and Menu Items

Maria,

My read of your post is that:-
In the Tools menu, you want only to display the Protection
menu item; and subordinate to this, you want to only
display the Protect Sheet submenu item (i.e. you want to
hide the Protect Workbook and Protect and Share Workbook
submenu items).

Be advised, I'm a little queasy offering this because I've
seen this type of code cause a complication in the past on
a different system. However, in the instance I refer to,
it was easily resolved. It DOES work on my system but
I've only tested it a few times and the code has been
hastily written.

Best regards,

Greg



-----Original Message-----
I would appreciate if someone could help with the VBA

code required to do
the following:
1) Hide all toolbars
2) In the menu display only the following: FILE (Save,

Save as, Close,
Exit), TOOLS (Protection, Protect/Unprotect Worksheet),
3) I intend to reset before close to revert back to

default

Thanks a lot

Maria .


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Changing Toolbar and Menu Items

Oops... I forgot to paste in the code.

Regards,
Greg

Sub FormatCommandBars()
Dim CB As CommandBar, CaptArr As Variant, i As Integer
Dim Ctrl As CommandBarControl, Item As CommandBarControl
Dim SubItem As CommandBarControl, KeepVis As Boolean

On Error Resume Next
CaptArr = Array(3, 106, 748, 752)
With Application
For Each CB In .CommandBars
If CB.Type = msoBarTypeNormal Then CB.Visible = False
Next
For Each Ctrl In .CommandBars(1).Controls
If Ctrl.ID = 30002 Then
For Each Item In Ctrl.Controls
For i = 1 To 4
If Item.ID = CaptArr(i) Then KeepVis = True
Next
If KeepVis = False Then Item.Visible = False
KeepVis = False
Next
ElseIf Ctrl.ID = 30007 Then
For Each Item In Ctrl.Controls
If Item.ID = 30029 Then
For Each SubItem In Item.Controls
If SubItem.ID < 893 Then SubItem.Visible = False
Next
Else
Item.Visible = False
End If
Next
Else
Ctrl.Visible = False
End If
Next
End With

End Sub

-----Original Message-----
Maria,

My read of your post is that:-
In the Tools menu, you want only to display the

Protection
menu item; and subordinate to this, you want to only
display the Protect Sheet submenu item (i.e. you want to
hide the Protect Workbook and Protect and Share Workbook
submenu items).

Be advised, I'm a little queasy offering this because

I've
seen this type of code cause a complication in the past

on
a different system. However, in the instance I refer to,
it was easily resolved. It DOES work on my system but
I've only tested it a few times and the code has been
hastily written.

Best regards,

Greg



-----Original Message-----
I would appreciate if someone could help with the VBA

code required to do
the following:
1) Hide all toolbars
2) In the menu display only the following: FILE (Save,

Save as, Close,
Exit), TOOLS (Protection, Protect/Unprotect Worksheet),
3) I intend to reset before close to revert back to

default

Thanks a lot

Maria .


.

.

Reply
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
Menu items Pietro Excel Discussion (Misc queries) 2 March 1st 07 10:41 AM
Excel should have case changing menu items like Word. Bill Friedman Excel Worksheet Functions 1 February 1st 06 03:58 AM
Favourites Items in the Toolbar Fish Head Excel Discussion (Misc queries) 3 December 7th 05 01:14 AM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
"work items toolbar" UncleVinny Excel Discussion (Misc queries) 4 December 21st 04 12:59 AM


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

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

About Us

"It's about Microsoft Excel"