Greetings,
Well, the below code was written for Excel 2003. Basically, it created a dropdown menu, that always was placed on the bottom of the toolbar at the left.
Well, I moved up to Excel 2007, and the code is not doing that task any longer. Is this possible in the 2007? any thoughts on how to accomplish the same concept?
Thanks,
Brad
Private Sub Workbook_Activate()
On Error Resume Next
Application.CommandBars(“CR Actions”).Visible = True
‘ Worksheets(“Workbook Contents Page1”).Activate
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars(“CR Actions”).Delete
End Sub
Private Sub Workbook_Deactivate()
On Error Resume Next
Application.CommandBars(“CR Actions”).Visible = False
End Sub
Private Sub Workbook_Open()
Call CreateVariousDropdown
End Sub
Public Sub CreateVariousDropdown()
Dim cbr As CommandBar
Dim cbp As CommandBarPopup
Dim cbb As CommandBarButton
Set cbr = Application.CommandBars.Add(“CR Actions”)
cbr.Position = msoBarTop
Set cbb = cbr.Controls.Add(msoControlButton)
With cbb
.Caption = “CR Actions”
.OnAction = “Select_Form”
.Style = msoButtonIconAndCaption
.FaceId = 2950
End With
Set cbp = cbr.Controls.Add(msoControlPopup)
cbp.Caption = “Various”
Set cbb = cbp.Controls.Add(msoControlButton)
With cbb
.Caption = “CR Sort”
.OnAction = “CRSort”
.Style = msoButtonIconAndCaption
.FaceId = 2174
End With
Set cbb = Nothing
Set cbp = Nothing
Set cbr = Nothing
End Sub