+ Reply to Thread
Results 1 to 6 of 6

can not reference objectbuttons within frame

  1. #1
    Registered User
    Join Date
    02-24-2004
    Posts
    12

    can not reference objectbuttons within frame

    On an Excel 2003 spreadsheet I already have two option buttons. I need to add two additional optionbuttons. I placed them within a frame so that they will function independently of the other buttons. Specifically, I created Frame1, selected Frame Object-->Edit, select Toolbox, add Optionbutton3 and Optionbutton4, exit Design mode.

    The new Optionbuttons correctly toggle their values when out of design mode . When I re-enter design mode and double-click to take me to the VBA code, it however only shows me Frame1_Click(). Within Frame1_Click() I have tried adding the code
    Please Login or Register  to view this content.
    , but when it is triggered I get the error message "Object doesn't support this property or method". When I look in Object Browser, I see Frame1 and Frame1_Click, but not Optionbutton3 or Optionbutton4. How do I reference these optionbuttons within the frame?

    Thanks,
    Cory
    Last edited by Langston; 09-09-2009 at 09:58 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,973

    Re: can not reference objectbuttons within frame

    If they are on a worksheet, you should be able to just use:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    02-24-2004
    Posts
    12

    Re: can not reference objectbuttons within frame

    I tried your suggestion, but when I use
    Please Login or Register  to view this content.
    I get an error message "Object required".

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,973

    Re: can not reference objectbuttons within frame

    Oh, I see what you did. You could use:
    Please Login or Register  to view this content.
    though personally I would either skip the frame and just set the GroupName property, or use Forms controls instead which are generally more stable on worksheets anyway.

  5. #5
    Registered User
    Join Date
    02-24-2004
    Posts
    12

    Re: can not reference objectbuttons within frame

    Thanks. I did not realize that assigning a different GroupName caused the optionbuttons to function separately from the other optionbuttons. I thought I had to put them within a frame to accomplish this. Though I still wonder why I could not reference them within the frame, your solution solves my problem. I appreciate the help!

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,973

    Re: can not reference objectbuttons within frame

    The Frame control functions differently from the other ActiveX controls (which is why it's not on the Toolbox by default)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1