Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Hide or delete "Add-Ins" in ribbon

In XL 2007, I add a program that adds a custom menu item to the shortcut menu
and it works fine.

BUT, two things:

1) A menu item in the ribbon called "Add-Ins" appears. How can I delete or
hide this?

2) In the "Add-Ins" item, the custom shortcut menu item appears 5 times.
Why? [I know this is sort of moot since I want to get rid of "Add-Ins"
anyway, but I'm curious why this happens - at some point I'll probably need
to fix it.]

Thanks for any help on this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hide or delete "Add-Ins" in ribbon

Post the code that create the shortcut

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
In XL 2007, I add a program that adds a custom menu item to the shortcut menu
and it works fine.

BUT, two things:

1) A menu item in the ribbon called "Add-Ins" appears. How can I delete or
hide this?

2) In the "Add-Ins" item, the custom shortcut menu item appears 5 times.
Why? [I know this is sort of moot since I want to get rid of "Add-Ins"
anyway, but I'm curious why this happens - at some point I'll probably need
to fix it.]

Thanks for any help on this.

  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Hide or delete "Add-Ins" in ribbon

In this workbook module:

Private Sub Workbook_Activate()
Call ShortCutMenuModify
End Sub

Private Sub Workbook_Deactivate()
Call ShortCutMenuReset
End Sub

In standard module:

Public Function ShortCutMenuModify()
Dim cbBar As CommandBar
Dim lX As Long
On Error Resume Next
For lX = 1 To Application.CommandBars.Count
If CommandBars(lX).Type = msoBarTypePopup And CommandBars(lX).BuiltIn =
True Then
Set cbBar = Application.CommandBars(lX)
With cbBar
.Controls.Add Type:=msoControlButton, Befo=1
.Controls(1).Caption = "Custom"
.Controls(1).FaceId = 5828
.Controls(1).OnAction = "RunCode"
If .Controls.Count 2 Then .Controls(2).BeginGroup = True
End With
End If
Next lX
On Error GoTo 0
End Function

Public Function ShortCutMenuReset()
Dim cmdBar As CommandBar
Dim lngX As Long
For lngX = 1 To Application.CommandBars.Count
If CommandBars(lngX).Type = msoBarTypePopup And
CommandBars(lngX).BuiltIn = True Then CommandBars(lngX).Reset
Next lngX
End Function

At first I thought that maybe 5 menus were affected and therefore, it
appears 5 times, but I counted the items and there are 65 menus affected, so
this has nothing to do with it...

Please let me know if you want me to post my shortcut menu as well...


"Ron de Bruin" wrote:

Post the code that create the shortcut

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
In XL 2007, I add a program that adds a custom menu item to the shortcut menu
and it works fine.

BUT, two things:

1) A menu item in the ribbon called "Add-Ins" appears. How can I delete or
hide this?

2) In the "Add-Ins" item, the custom shortcut menu item appears 5 times.
Why? [I know this is sort of moot since I want to get rid of "Add-Ins"
anyway, but I'm curious why this happens - at some point I'll probably need
to fix it.]

Thanks for any help on this.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hide or delete "Add-Ins" in ribbon

Hi XP

It is on my list to test tomorrow

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
In this workbook module:

Private Sub Workbook_Activate()
Call ShortCutMenuModify
End Sub

Private Sub Workbook_Deactivate()
Call ShortCutMenuReset
End Sub

In standard module:

Public Function ShortCutMenuModify()
Dim cbBar As CommandBar
Dim lX As Long
On Error Resume Next
For lX = 1 To Application.CommandBars.Count
If CommandBars(lX).Type = msoBarTypePopup And CommandBars(lX).BuiltIn =
True Then
Set cbBar = Application.CommandBars(lX)
With cbBar
.Controls.Add Type:=msoControlButton, Befo=1
.Controls(1).Caption = "Custom"
.Controls(1).FaceId = 5828
.Controls(1).OnAction = "RunCode"
If .Controls.Count 2 Then .Controls(2).BeginGroup = True
End With
End If
Next lX
On Error GoTo 0
End Function

Public Function ShortCutMenuReset()
Dim cmdBar As CommandBar
Dim lngX As Long
For lngX = 1 To Application.CommandBars.Count
If CommandBars(lngX).Type = msoBarTypePopup And
CommandBars(lngX).BuiltIn = True Then CommandBars(lngX).Reset
Next lngX
End Function

At first I thought that maybe 5 menus were affected and therefore, it
appears 5 times, but I counted the items and there are 65 menus affected, so
this has nothing to do with it...

Please let me know if you want me to post my shortcut menu as well...


"Ron de Bruin" wrote:

Post the code that create the shortcut

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
In XL 2007, I add a program that adds a custom menu item to the shortcut menu
and it works fine.

BUT, two things:

1) A menu item in the ribbon called "Add-Ins" appears. How can I delete or
hide this?

2) In the "Add-Ins" item, the custom shortcut menu item appears 5 times.
Why? [I know this is sort of moot since I want to get rid of "Add-Ins"
anyway, but I'm curious why this happens - at some point I'll probably need
to fix it.]

Thanks for any help on this.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hide or delete "Add-Ins" in ribbon

If I use this two testers the problem is only this menu that create the add-in tab
"PivotChart Menu

If I check for it no add-ins tab will be created

Do you see the same results ?

Note : From Jon Peltier in a older thread
It appears in those popups that relate to the worksheet
(such as Cell, Row, Column, etc.) but not in those relating to shapes or
charts, and that is where these enhanced popups are most needed.


Sub AddPopup()
Dim cb As CommandBar
Dim ctl As CommandBarButton
Dim I As Integer
For Each cb In Application.CommandBars
If cb.Type = msoBarTypePopup And cb.BuiltIn And cb.Name < "PivotChart Menu" Then
I = I + 1
cb.Reset
Set ctl = cb.Controls.Add(Type:=msoControlButton)
ctl.Caption = "MyMenu " & cb.Name
ctl.FaceId = 80
ctl.Visible = True
Debug.Print cb.Name
End If
Next
MsgBox I
End Sub

Sub ResetPopup()
Dim cb As CommandBar
Dim ctl As CommandBarButton
Dim I As Integer
For Each cb In Application.CommandBars
If cb.Type = msoBarTypePopup And cb.BuiltIn Then
I = I + 1
cb.Reset
End If
Next
MsgBox I
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ron de Bruin" wrote in message ...
Hi XP

It is on my list to test tomorrow

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
In this workbook module:

Private Sub Workbook_Activate()
Call ShortCutMenuModify
End Sub

Private Sub Workbook_Deactivate()
Call ShortCutMenuReset
End Sub

In standard module:

Public Function ShortCutMenuModify()
Dim cbBar As CommandBar
Dim lX As Long
On Error Resume Next
For lX = 1 To Application.CommandBars.Count
If CommandBars(lX).Type = msoBarTypePopup And CommandBars(lX).BuiltIn =
True Then
Set cbBar = Application.CommandBars(lX)
With cbBar
.Controls.Add Type:=msoControlButton, Befo=1
.Controls(1).Caption = "Custom"
.Controls(1).FaceId = 5828
.Controls(1).OnAction = "RunCode"
If .Controls.Count 2 Then .Controls(2).BeginGroup = True
End With
End If
Next lX
On Error GoTo 0
End Function

Public Function ShortCutMenuReset()
Dim cmdBar As CommandBar
Dim lngX As Long
For lngX = 1 To Application.CommandBars.Count
If CommandBars(lngX).Type = msoBarTypePopup And
CommandBars(lngX).BuiltIn = True Then CommandBars(lngX).Reset
Next lngX
End Function

At first I thought that maybe 5 menus were affected and therefore, it
appears 5 times, but I counted the items and there are 65 menus affected, so
this has nothing to do with it...

Please let me know if you want me to post my shortcut menu as well...


"Ron de Bruin" wrote:

Post the code that create the shortcut

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
In XL 2007, I add a program that adds a custom menu item to the shortcut menu
and it works fine.

BUT, two things:

1) A menu item in the ribbon called "Add-Ins" appears. How can I delete or
hide this?

2) In the "Add-Ins" item, the custom shortcut menu item appears 5 times.
Why? [I know this is sort of moot since I want to get rid of "Add-Ins"
anyway, but I'm curious why this happens - at some point I'll probably need
to fix it.]

Thanks for any help on this.

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
Excel "Move or Copy" and "Delete" sheet functions dsiama Excel Worksheet Functions 1 December 28th 07 01:57 PM
Custom Ribbon example in Walkenbach's "Excel 2007 Power Programming with VBA" Greg Lovern Excel Programming 1 September 16th 07 03:42 PM
Delete/Hide PivotTable PageFields "(ALL)" Option Charles Excel Programming 1 July 29th 04 04:40 AM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM
Make "Worksheet Menu Bar" invisible or Delete/hide it's buttons Bob Phillips[_5_] Excel Programming 0 August 11th 03 01:05 PM


All times are GMT +1. The time now is 01:55 PM.

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"