How to trap the OnAction of a CommandBarPopup

R

R Avery

Whenever i have wanted to trap the click or action event of a popup
menuitem, I have just set the .OnAction property to a particular sub
name. However, I am trying to wrap some of this code in a class, and I
am having trouble. The OnAction parameter can't refer to a class's
procedure (as far as i know), and there are no events that the
CommandBarPopup sources... so how can I accomplish this? Any help would
be most appreciated.
 
S

Stephen Bullen

Hi R,
However, I am trying to wrap some of this code in a class, and I
am having trouble. The OnAction parameter can't refer to a class's
procedure (as far as i know), and there are no events that the
CommandBarPopup sources... so how can I accomplish this? Any help would
be most appreciated.

Only the CommandBarButton and CommandBarComboBox source events, so you need
to use those objects in your class modules (usually the CommandBarButton)

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk
 
R

R Avery

Ok. The purpose of doing this is so that the sub menuitems populate at
run-time, when the user wants to see the contents of the menu. It is
possible to do this using the OnAction property as long as the all the
code is contained in a regular module.

Instead, i thought it might be cleaner to have some sort of event that i
can trap. But if this is not possible, then there is no point. I
thought there might have been a way around that, but i guess not. Thanks.
 
S

Stephen Bullen

Hi,
The purpose of doing this is so that the sub menuitems populate at
run-time, when the user wants to see the contents of the menu.

I hear you, but I'm afraid the CommandBarPopup control doesn't source
events. I've sent the request for a BeforePopup event to Microsoft a
few times, but to no avail (yet).

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top