Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
CommandBars.Add problem
I am trying to create a toolbar with a button on it in the Workbook.Activate
event. Below is the code so far. I error out at the With TBar .Name line so I don't know if anything else is wrong. Help would be greately appreciated. Sub MakeToolbarBtn() ' ' Create new toolbar and button Dim TBar As CommandBar Dim NewBtn As CommandBarButton Set TBar = CommandBars.Add With TBar .Name = "WWEnviro" .Top = 0 .Left = 0 .Visible = True End With Set NewBtn = CommandBars("WWEnviro").Controls.Add _ (Type:=msoControlButton) With NewBtn .FaceId = 300 .OnAction = "FixIt" .Caption = "FixFormatting" End With On Error Resume Next 'On Error GoTo 0 End Sub Thank you |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA problem with CommandBars | Excel Programming | |||
commandbars in add-in | Excel Programming | |||
Commandbars dynamic menu creation problem | Excel Programming | |||
CommandBars vs CommandBars(1).Controls | Excel Programming | |||
CommandBars | Excel Programming |