Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Adding a Dropdown Control to a Command Baar

I would like to replace one of the command buttons with a dropdown control.
I would like the dropdown control to have several list items, each of which
should have an onAction property.

Here is what I am starting with.

Any help and some example code woud be much appreciated.

Thanks,


Sub OpenCommandBar()

Dim cb As CommandBar
Dim cbb As CommandBarButton

Set cb = Application.CommandBars.Add("Dashboard Controls", _
msoBarFloating, False, True)
cb.Enabled = True
cb.Visible = True

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Refresh Data"
cbb.FaceId = 159
cbb.OnAction = "InitializeDataInput2"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Generate Reports"
cbb.FaceId = 433
cbb.OnAction = "ProcessReportSet01"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Print Reports"
cbb.FaceId = 4
cbb.OnAction = "PrintSet01"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "eMail Reports"
cbb.FaceId = 258
cbb.OnAction = "CreateAndEmailReports"

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Adding a Dropdown Control to a Command Bar

You omitted the "control"...
'--
Sub OpenCommandBar()
Dim cb As CommandBar
Dim cbb As CommandBarButton
Dim cbc As CommandBarControl

Set cb = Application.CommandBars.Add("Dashboard Controls", _
msoBarFloating, False, True)
cb.Enabled = True
cb.Visible = True

Set cbc = cb.Controls.Add(msoControlPopup)
cbc.Caption = "Refresh Data"
cbc.OnAction = "InitializeDataInput2"
'cbc.FaceId = 159
'cbc.Style = msoButtonIconAndCaption

Set cbb = cbc.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Generate Reports"
cbb.FaceId = 433
cbb.OnAction = "ProcessReportSet01"

Set cbb = cbc.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Print Reports"
cbb.FaceId = 4
cbb.OnAction = "PrintSet01"

Set cbb = cbc.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "eMail Reports"
cbb.FaceId = 258
cbb.OnAction = "CreateAndEmailReports"
End Sub
--
Jim Cone
Portland, Oregon USA


"Tom Joseph"

wrote in message
I would like to replace one of the command buttons with a dropdown control. I would like the dropdown control to have several list
items, each of which
should have an onAction property.
Here is what I am starting with.
Any help and some example code woud be much appreciated.
Thanks,


Sub OpenCommandBar()
Dim cb As CommandBar
Dim cbb As CommandBarButton

Set cb = Application.CommandBars.Add("Dashboard Controls", _
msoBarFloating, False, True)
cb.Enabled = True
cb.Visible = True

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Refresh Data"
cbb.FaceId = 159
cbb.OnAction = "InitializeDataInput2"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Generate Reports"
cbb.FaceId = 433
cbb.OnAction = "ProcessReportSet01"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Print Reports"
cbb.FaceId = 4
cbb.OnAction = "PrintSet01"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "eMail Reports"
cbb.FaceId = 258
cbb.OnAction = "CreateAndEmailReports"
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Adding a Dropdown Control to a Command Bar

Jim,

Thanks, once again. I appreciate the help.

Tom

"Jim Cone" wrote:

You omitted the "control"...
'--
Sub OpenCommandBar()
Dim cb As CommandBar
Dim cbb As CommandBarButton
Dim cbc As CommandBarControl

Set cb = Application.CommandBars.Add("Dashboard Controls", _
msoBarFloating, False, True)
cb.Enabled = True
cb.Visible = True

Set cbc = cb.Controls.Add(msoControlPopup)
cbc.Caption = "Refresh Data"
cbc.OnAction = "InitializeDataInput2"
'cbc.FaceId = 159
'cbc.Style = msoButtonIconAndCaption

Set cbb = cbc.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Generate Reports"
cbb.FaceId = 433
cbb.OnAction = "ProcessReportSet01"

Set cbb = cbc.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Print Reports"
cbb.FaceId = 4
cbb.OnAction = "PrintSet01"

Set cbb = cbc.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "eMail Reports"
cbb.FaceId = 258
cbb.OnAction = "CreateAndEmailReports"
End Sub
--
Jim Cone
Portland, Oregon USA


"Tom Joseph"

wrote in message
I would like to replace one of the command buttons with a dropdown control. I would like the dropdown control to have several list
items, each of which
should have an onAction property.
Here is what I am starting with.
Any help and some example code woud be much appreciated.
Thanks,


Sub OpenCommandBar()
Dim cb As CommandBar
Dim cbb As CommandBarButton

Set cb = Application.CommandBars.Add("Dashboard Controls", _
msoBarFloating, False, True)
cb.Enabled = True
cb.Visible = True

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Refresh Data"
cbb.FaceId = 159
cbb.OnAction = "InitializeDataInput2"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Generate Reports"
cbb.FaceId = 433
cbb.OnAction = "ProcessReportSet01"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "Print Reports"
cbb.FaceId = 4
cbb.OnAction = "PrintSet01"

Set cbb = cb.Controls.Add(msoControlButton)
cbb.Style = msoButtonIconAndCaption
cbb.Caption = "eMail Reports"
cbb.FaceId = 258
cbb.OnAction = "CreateAndEmailReports"
End Sub


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
Addding dropdown to command bar Tom Joseph Excel Programming 1 February 7th 09 12:56 PM
Adding a Dropdown Control to a Command Bar Tom Joseph Excel Programming 3 February 7th 09 12:55 PM
dropdown control Walmir Excel Programming 2 July 3rd 08 07:07 PM
Loss of dropdown control when publishing Kelly Mayo Excel Worksheet Functions 0 September 22nd 06 03:22 PM
Dropdown control as multiline Bob Umlas[_3_] Excel Programming 0 August 15th 03 08:12 PM


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

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"