Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have an excel embeded in a word. I edit the excel in-place and i want when
the user tries to open the context menu to show another context menu. But an error appears: Run-time error '-2147467259 (80004005)': Method 'Add' of Object '_CommandBars' failed Here is the method: Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) Dim myBar As CommandBar Dim barOpen As CommandBarButton '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''' ' This is where i get that error Set myBar = Application.CommandBars.Add(Name:="MyCustomButton" , Position:=msoBarMenuBar, temporary:=True) ''''''''''''''''''''''''''''''''''''''''''''''''' Set barOpen = myBar.Controls.Add(Type:=msoControlButton, ID:=1, temporary:=True) With barOpen .Caption = "Open" .OnAction = "Sheet1.Open" End With End Sub Is there a way to do this? Do you have another solution? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a Work place time sheet. | Excel Worksheet Functions | |||
Place a Dynamic Date + a Certain Time in a Cell | Excel Worksheet Functions | |||
How do place a column of date/time information into a calendar for | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
commandbar problems | Excel Discussion (Misc queries) |