|
-
Aug 28th, 2001, 11:57 AM
#1
Thread Starter
Lively Member
Toolbars in VBA
Help!
I'm busy writing a toolbar for MS Excel and stuck with an Excel 5.0 Manual. Please look at this code, just setting up a new CommandBar and putting a large button in it.
Code:
Sub setUpTestBar()
CommandBars.Add "Test"
With CommandBars("Test")
.Visible = True
.Controls.Add Type:=msoControlButton
.Controls(1).Caption = "Caption"
.Controls(1).Enabled = True
.Controls(1).DescriptionText = "DescText"
.Controls(1).State = msoButtonUp
.Controls(1).Visible = True
.Controls(1).TooltipText = "Tooltip Text"
.Controls(1).OnAction = "myModule.mySub"
.Controls(1).Width = 100
End With
End Sub
I can now click the button and it will fire up my program. In fact, it works perfectly, with the exception that I can't make the button bear a name. I don't even want a picture, just a name!
The PC can't replace your life...
...but you can get a great break with it
VB6, (D)HTML, JavaScript, TI-85 
German, English, Portuguese, Spanish, French & a bit of latin 
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
|