S
sarah
im having huge problems with a popup menu.
Everytime i run the macro it creates a new shortcutmenu item however if i
run the mcro few times i have the same menu item added everytime. I was
trying to code it so that if it already existed it would delete it and create
a new one using code like this :
Set clarpop = ShortCutMenu.Controls.Add(Type:=msoControlPopup)
For Each clarpop In ShortCutMenu.Controls
clarpop.Delete
Next clarpop
With clarpop
.Tag = "Litriu"
.Caption = "&Litriú"
.OnAction = "MenuAction"
End With
However that was giving me errors
Then i tried an if statement saying if there were less than 11 controls on
the shortcutmenu to add a new one otherwise dont - that didnt show any menu
item.
deleting menu item seems to always throw errors.
Any word of advice??
Everytime i run the macro it creates a new shortcutmenu item however if i
run the mcro few times i have the same menu item added everytime. I was
trying to code it so that if it already existed it would delete it and create
a new one using code like this :
Set clarpop = ShortCutMenu.Controls.Add(Type:=msoControlPopup)
For Each clarpop In ShortCutMenu.Controls
clarpop.Delete
Next clarpop
With clarpop
.Tag = "Litriu"
.Caption = "&Litriú"
.OnAction = "MenuAction"
End With
However that was giving me errors
Then i tried an if statement saying if there were less than 11 controls on
the shortcutmenu to add a new one otherwise dont - that didnt show any menu
item.
deleting menu item seems to always throw errors.
Any word of advice??