|
-
Feb 20th, 2004, 12:15 PM
#1
Thread Starter
New Member
msoControlButtonPopup "Invalid Procedure Call"
I'm trying to create a Custom (blank) CommanBarPopup of Type:=msoControlButtonPopup (would prefer msoControlSplitButtonPopup). Microsofts website hasn't helped at all. Here's what I've got so far.
Sub Create_MyBar()
Dim Bar As CommandBar
Dim Pop As CommandBarPopup
Set Bar = CommandBars.Add("My Bar")
Set Pop = Bar.Controls.Add(msoControlButtonPopup)
End Sub
On the Line "Set Pop = Bar.Controls.Add(msoControlButtonPopup)" I get an "Invalid Procedure Call".
-
Feb 21st, 2004, 12:01 AM
#2
Lively Member
VB Code:
Set Pop = Bar.Controls.Add([U]Type:=[/U]msoControlButtonPopup)
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
-
Feb 23rd, 2004, 09:15 AM
#3
Thread Starter
New Member
I tried it with the "Type:=" call and it still gives me an invalid procedure call. I don't understand why I can't create this button with the following code.
VB Code:
Sub Create_MyBar()
Dim Bar As CommandBar
Dim Pop As CommandBarPopup
Set Bar = CommandBars.Add("My Bar")
Set Pop = Bar.Controls.Add(Type:=msoControlButtonPopup)
End Sub
-
Feb 23rd, 2004, 01:41 PM
#4
Lively Member
VB Code:
Dim toolbar As CommandBar
Set toolbar = CommandBars.Add
' Make sure it is visible
With toolbar
.Name = "My Bar"
.Position = msoBarTop
.Protection = msoBarNoCustomize
.Visible = True
End With
'Load it
Set Button = CommandBars("My Bar").Controls.Add(Type:=msoControlButtonPopup)
'Adjust the button if you want
With Button
.OnAction = "Macro1"
.Style = msoButtonIconAndCaption
.FaceId = 300
.caption = "Drop Me Down"
End With
Last edited by Daniel McCool; Feb 23rd, 2004 at 01:47 PM.
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
-
Feb 23rd, 2004, 01:52 PM
#5
Thread Starter
New Member
Here's what I've got now
VB Code:
Sub Create_MyBar()
Dim Bar As CommandBar
Dim Button As CommandBarPopup
Set Bar = CommandBars.Add("My Bar")
Set Button = CommandBars("My Bar").Controls.Add(Type:=msoControlButtonPopup)
End Sub
The code does create the CommandBar named "My Bar", but errors out on the Set Button. It's almost like it won't allow acess to creating a msoControlButtonPopup. The buttons I know I can make are msoControlButton, msoControlEdit, msoControlPopup, msoControlDropdown, and msoControlComboBox. This is completely confusing me.
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
|