Excel 2007: Events For Activex Controls Embedded in Microsoft Forms 2.0 Frame

I have placed a Microsoft Forms 2.0 Frame on an Excel 2007 worksheet.  I right-clicked the frame and added two optionbuttons to the frame.  I can see the events for the frame, but I can't figure out how to see the events for each of the embedded optionbuttons.  I want to trigger an event when either of the embedded optionbuttons are clicked.

What am I missing?

Many Thanks,

Bill Vallance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Patrick MatthewsCommented:
If you go to the sheet module for that worksheet, you will be able to leverage the events.  Select "OptionButton1" or whatever in the left-hand dropdown over the code pane, and then select your event from the right-hand dropdown.

I must say, though, that I advise against embedding ActiveX in a worksheet.  They simply do not behave well in worksheets.
bvallancAuthor Commented:
I just opened a brand new Excel 2007 worbook.  On Sheet1 I placed a Microsoft Forms 2.0 Frame.  I right-cliked the frame and added two (2) optionbuttons - OptionButton1 and OptionButton2.  I opened the Visual Basic editor, opened the Sheet1 code module, and looked for the OptionButton1 and OptionButton2 in the left-hand listing of controls that have events.  Neither OptionButton1 or OptionButton2 is listed.  The Frame is listed, but neither of the optionbuttons.

Do I need to configure some other setting in Excel for these embedded optionbuttons to become visible in their sheet code module?


Bill Vallance
Patrick MatthewsCommented:

Your question indicated that you placed ActiveX option buttons in the frame, and I based my response on that.

If what you really have are Forms option buttons, then my advice is not applicable, and the method I described will not expose their events.

(That said, my warning about ActiveX controls in a worksheet still applies.  I dislike using controls generally, but if one must use controls, the Forms controls are generally more well-behaved than the ActiveX controls.)

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

bvallancAuthor Commented:
Thanks for your response, Patrick (I assume I have the right name?).  I was probably presumtuous in using the work "Activex" in the title of this question.  I assumed that the Microsoft Forms 2.0 Frame is an activex control because I accessed it from the Excel 2007 activex controls toolbox (by clicking the "More" buttom).  At this point I don't know whether the Microsoft Forms 2.0 Frame control is an activex or forms control.

Whatever type of control the Microsoft Forms 2.0 Frame may be, the behavior I described in my previous post (38862421) is what I am experiencing.  Googling this problem turns up several developers experiencing this same problem but no answer is ever given.  It appears that this frame control was never designed to handle embedded control events, just VBA status polling of the ActiveControl status of the embedded controls.


Bill Vallance
Patrick MatthewsCommented:
Yes, that's the right name :)

The Forms controls don't offer the same level of programmability that ActiveX controls offer.

Now, there is a virtue in that simplicity: they are far more stable when embedded in a worksheet than the ActiveX controls are.

If you use Forms option buttons, you can get a Click event by right clicking the control and selecting 'assign macro', but in terms of getting other events in your scenario I am at a loss.

You may want to click Request Attention and ask the Mods to send alerts to additional Experts.
Rory ArchibaldCommented:
It looks to me as though you have an ActiveX Frame but Forms optionbuttons. The Frame wil therefore expose events, but the optionbuttons won't - they can only be assigned macros as Patrick said.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bvallancAuthor Commented:
Thanks to both of you for your time and responses.  Rorya, that's exactly what it feels like to me, too.  I cut my losses with the Microsoft Forms 2.0 Frame and deleted it.  I used standard Activex optionbuttons, GroupNamed them, and placed a rectangular shape around them.  That construct works just like its supposed to.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.