C
CLarkou
I developed an add-in in Office XP. I am assigning procedure names on
my toolbar buttons and I am creating temporarily on menu bar a new
item for my program. As soon as client tries to select any button from
my toolbar or any item from the menu bar, error appears "Method
OnAction of object '_CommandBarButton' failed". Is there any solution
for this ?
This is the code I am using:
Dim cbr_menu As CommandBar
Dim cbr_control As CommandBarControl
Dim cbr_button As CommandBarButton
'-------------------------------------- Excel MENU
-----------------------------
Set cbr_menu = CommandBars.ActiveMenuBar 'Worksheet Menu Bar
Set cbr_control = cbr_menu.Controls.Add(msoControlPopup, , , , True)
With cbr_control
.Caption = "MyProgram"
.Tag = "MyProgram"
End With
'--------------------------------------------------------------
'open database
Set cbr_button = cbr_control.Controls.Add(msoControlButton, , , ,
True)
With cbr_button
.Style = msoButtonCaption
.Caption = "Select Database"
.Tag = "Select Database"
.OnAction = "MNU_show_Ufr_databases_list"
End With
my toolbar buttons and I am creating temporarily on menu bar a new
item for my program. As soon as client tries to select any button from
my toolbar or any item from the menu bar, error appears "Method
OnAction of object '_CommandBarButton' failed". Is there any solution
for this ?
This is the code I am using:
Dim cbr_menu As CommandBar
Dim cbr_control As CommandBarControl
Dim cbr_button As CommandBarButton
'-------------------------------------- Excel MENU
-----------------------------
Set cbr_menu = CommandBars.ActiveMenuBar 'Worksheet Menu Bar
Set cbr_control = cbr_menu.Controls.Add(msoControlPopup, , , , True)
With cbr_control
.Caption = "MyProgram"
.Tag = "MyProgram"
End With
'--------------------------------------------------------------
'open database
Set cbr_button = cbr_control.Controls.Add(msoControlButton, , , ,
True)
With cbr_button
.Style = msoButtonCaption
.Caption = "Select Database"
.Tag = "Select Database"
.OnAction = "MNU_show_Ufr_databases_list"
End With