Link to home
Start Free TrialLog in
Avatar of bvallanc
bvallancFlag for United States of America

asked on

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
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

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.
Avatar of bvallanc

ASKER

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?

Thanks,

Bill Vallance
Bill,

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.)

Patrick
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.

Thoughts?

Bill Vallance
SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.