Using frame controls on a worksheet

  • I have a frame control placed on an Excel worksheet which contains several other controls. I can reference the contained controls using (for example) frame1.controls(1), but I can't see where the event handlers for the contained controls are- Excel creates event handers for the frame, but not the controls that it contains...
    How can I access these event handlers and write code that responds to the controls inside the frame?


    Any ideas?
    :)

  • Re: Using frame controls on a worksheet


    You can eventually try to record a macro while using the frame controls. Afterwards you can see in Modul1 in VBA how EXCEL access these controls.


    Have used the "Record Macro" sometimes when I feel I can't figured out what to dol.


    /Kokken

  • Re: Using frame controls on a worksheet


    Thx, but the macro recorder doesn't help in this case.


    To recap, this is a Microsoft forms 2.0 frame on a worksheet.
    If I add this, then right click and select Frame Object, then Edit, a toolbox appears, from which I can add a command button.
    I know that the button is added inside the frame, because they move together when I drag them.
    However, the contained button has no event handlers in vba.
    The frame itself does, but not the button I added to it.


    Also, I can't seem to add controls from the normal control toolbar to the frame at all- only Forms controls.
    Can anyone at least replicate this problem?

  • Re: Using frame controls on a worksheet


    Any body got any idea on this topic?


    I am also facing the same problem.


    Can anybody help???????????????


    Thanks and Regards,
    Bhuvana

  • Re: Using frame controls on a worksheet


    I don't know if this is any help, but I thought that only controls created from the control toolbox had events. Controls created using forms can only be assigned macros... Which is why you can't pick and mix wrt forms and controls, and why also why you are unable to see events for the form objects that you have created...
    try creating some control items on a test spreadsheet, and see if you are able to access the event handlers for them on the code for that sheet....

  • Re: Using frame controls on a worksheet


    Actually I am having one frame inside this I am having one command button. While clickint the button which is there inside the frame, I need to do some activities. But there is no click event for that button which is there in the frame. Only frame's click even is there. What should i do in this case?

  • Re: Using frame controls on a worksheet


    Quote from bhuvana

    Actually I am having one frame inside this I am having one command button. While clickint the button which is there inside the frame, I need to do some activities. But there is no click event for that button which is there in the frame. Only frame's click even is there. What should i do in this case?


    when you right click the botton, what options do you get?
    if you want to use an event on the CONTROL command button that you have created, if you just double click it, it should bring up the vb editor.
    if you are using a FORM command button, then you need to assigna macro by right clicking, adn then selecting assign macro.


    If you have, in fact created a frame in which the button appears to sit, then I'd still try and double click the button - I found that it brings up the event for the button, not the button within the frame...


    I'm not 100% sure whether this answers your query, perhaps an example spreadsheet might help?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!