R
Roy Lasris
I have a custom, temporary, tool bar containing 2 drop down (combobox)
lists. I have added in each list an entry called <<Delete>> which, when clicked
by the user, is processed by the OnAction routine to delete the particular
list. (Not just clear it, but remove it from the parent.)
Assuming controls(2) is the 'active' list , this command is invoked
. . .
CommandBars("DropDownLists").Controls(2).Delete
. . .
and I get this result.
Method 'Delete' of Object '_CommandBarComboBox' failed.
It seems that if the active list is the one I am trying to delete, the command
fails. So I have tried to change the focus to the first list or the parent
control, e,g,
CommandBars("DropDownLists").SetFocus
and
CommandBars("DropDownLists").Controls(1).SetFocus
before the delete command is called, neither successfully works. (The focus is
changed, but the delete command returns the above error message.) Any
suggestions? (BTW, I can clear the list without problem, just cannot delete
it.)
Thanks,
Roy
lists. I have added in each list an entry called <<Delete>> which, when clicked
by the user, is processed by the OnAction routine to delete the particular
list. (Not just clear it, but remove it from the parent.)
Assuming controls(2) is the 'active' list , this command is invoked
. . .
CommandBars("DropDownLists").Controls(2).Delete
. . .
and I get this result.
Method 'Delete' of Object '_CommandBarComboBox' failed.
It seems that if the active list is the one I am trying to delete, the command
fails. So I have tried to change the focus to the first list or the parent
control, e,g,
CommandBars("DropDownLists").SetFocus
and
CommandBars("DropDownLists").Controls(1).SetFocus
before the delete command is called, neither successfully works. (The focus is
changed, but the delete command returns the above error message.) Any
suggestions? (BTW, I can clear the list without problem, just cannot delete
it.)
Thanks,
Roy