Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro works on F8 but not auto
Macro written to delete an addition to commandbar(1):
When it is invoked through the .onaction property that is defined when the menu item is added, the delete item macro fails. The error message is -2147467259(80004005) Method 'Delete' of object 'CommandBarPopup' failed. Strangely though, if I step through the macro incrementally (F8 F8 F8...) it works fine. I can't figure this one out. Thanks for any help! Neil |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro works on F8 but not auto
Neil,
Post your code. HTH, Bernie MS Excel MVP "Neil" wrote in message ... Macro written to delete an addition to commandbar(1): When it is invoked through the .onaction property that is defined when the menu item is added, the delete item macro fails. The error message is -2147467259(80004005) Method 'Delete' of object 'CommandBarPopup' failed. Strangely though, if I step through the macro incrementally (F8 F8 F8...) it works fine. I can't figure this one out. Thanks for any help! Neil |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro works on F8 but not auto
Here's the code...
Sub addtomenu() Dim dubam As CommandBarControl Set dubam = CommandBars(1).Controls.Add (Type:=msoControlPopup) dubam.Caption = "Return to DUBAM" With dubam .OnAction = "deletefrommenu" End With End Sub Sub deletefrommenu() Dim menuitem As CommandBarControl Dim count As Integer For Each menuitem In CommandBars(1).Controls count = count + 1 Set menuitem = CommandBars(1).Controls(count) If menuitem.BuiltIn = False Then menuitem.Delete End If Next Call go End Sub -----Original Message----- Neil, Post your code. HTH, Bernie MS Excel MVP "Neil" wrote in message ... Macro written to delete an addition to commandbar(1): When it is invoked through the .onaction property that is defined when the menu item is added, the delete item macro fails. The error message is -2147467259 (80004005) Method 'Delete' of object 'CommandBarPopup' failed. Strangely though, if I step through the macro incrementally (F8 F8 F8...) it works fine. I can't figure this one out. Thanks for any help! Neil . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet protected-auto filter works, show all button dosen't. | Excel Discussion (Misc queries) | |||
Macro works Macro does not work | Excel Discussion (Misc queries) | |||
Macro works but buttons don't | Excel Discussion (Misc queries) | |||
macro works for some users and doesn't for others | Excel Discussion (Misc queries) | |||
macro works in .xlt but not .xls | Excel Programming |