|
-
Jan 12th, 2005, 05:24 AM
#1
Thread Starter
Frenzied Member
Custom Pull-Down Menu in Excel
I'm sure I read here somewhere recently that you can't replace the default pull-down menus in Excel, but rather "overlay" your custom menus, in affect doing the same thing in the eyes of the user.
Is this true ?
I want to either replace or "overlay" pull-down menus in Excel, but am not really very up to speed in this area.
Can anyone offer any help ?
Thanks
-
Jan 12th, 2005, 12:36 PM
#2
Re: Custom Pull-Down Menu in Excel
You can find the control and set its visibility property to false and then add
your own custom one in the same place in the toolbar, etc. Use the .Find
method of the commandbars collection for the desired toolbar.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 13th, 2005, 03:51 AM
#3
Thread Starter
Frenzied Member
Re: Custom Pull-Down Menu in Excel
OK that makes about 60% sense to me so far .... but I'll keep snouting about and see what I can do.
Thanks again Rob
-
Jan 13th, 2005, 01:39 PM
#4
Re: Custom Pull-Down Menu in Excel
I wrote a small example for you. What it does is hide the standard save
menu item. Then it creates a new "Save Me" menu item in its place. I added
an event for it too that just shows a msgbox.
VB Code:
Option Explicit
Public WithEvents oCBBCustom As Office.CommandBarButton
Private Sub oCBBCustom_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
MsgBox "Save Me!"
End Sub
Private Sub Workbook_Open()
Dim oCB As Office.CommandBar
Dim oCBBFile As Office.CommandBarPopup
Dim oCBBSave As Office.CommandBarButton
Set oCB = Application.CommandBars("Worksheet Menu Bar")
Set oCBBFile = oCB.Controls("&File")
Set oCBBSave = oCBBFile.Controls("&Save")
oCBBSave.Visible = False
Set oCBBCustom = oCBBFile.Controls.Add(msoControlButton, 1, , 5, True)
With oCBBCustom
.Caption = "Save Me"
.BeginGroup = False
.Enabled = True
.Visible = True
End With
'oCB.Reset 'To reset the menu.
End Sub
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 14th, 2005, 03:37 AM
#5
Thread Starter
Frenzied Member
Re: Custom Pull-Down Menu in Excel
Thanks a lot Rob ... much appreciated
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|