+ Reply to Thread
Results 1 to 4 of 4

Return Value of CheckBox object in a worksheet. Error "Object Required"

  1. #1
    Registered User
    Join Date
    01-31-2020
    Location
    Chicago, USA
    MS-Off Ver
    2016
    Posts
    17

    Return Value of CheckBox object in a worksheet. Error "Object Required"

    Hi,

    I put a checkbox onto a worksheet and I would like to take some VBA action if it is clicked or unclicked. The way I have written the code is returning an error "Object Required", so I guess that I am not referencing it correctly. Here is my simple code:

    Please Login or Register  to view this content.
    Also, How do I change the name of this object from the generic name that Excel assigned? This checkbox is in a worksheet, and I'm not sure how to bring up the properties editor like I would in the VBA editor

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Return Value of CheckBox object in a worksheet. Error "Object Required"

    Try

    Please Login or Register  to view this content.
    Martin

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Return Value of CheckBox object in a worksheet. Error "Object Required"

    I replicated what you described and this code works fine for me. You probably have some other issue with something you didn't describe. What module is this code in? It should be in the module for the worksheet that has the checkbox. See my file for an example using your code.

    You can attach your file here if you'd like.

    To change the name, in the Developer tab click Design Mode. Then you can do one of two things:

    1. Click on the checkbox to select it. Go to the address box (just above the column label "A") and retype the desired name.
    2. Right-click on the checkbox, and select Properties to bring up the properties list. Then you can change the name.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Return Value of CheckBox object in a worksheet. Error "Object Required"

    I assumed you were using an ActiveX control, because of your reference to checkbox6.value. However, if your control is actually a Forms control, then this code will not work. You need to do this instead:
    Please Login or Register  to view this content.
    Quote Originally Posted by mrice View Post
    Try

    Please Login or Register  to view this content.
    Me will not refer to the control; it will refer to the object that owns the code module (e.g., sheet) and will cause an error if used in a standard module.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] CommandButton1.Backcolor = Number, Getting / Run time error "424" Object Required
    By Harvey3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2019, 07:33 PM
  2. "Object required" error upon "Exit Function" statement
    By 6StringJazzer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-24-2018, 06:40 PM
  3. [SOLVED] "ActiveWorkbook.Path" fails - triggers "Compile Error Object required"
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2018, 02:58 PM
  4. WINS Office Integration "System error Object required"
    By aprildu in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 09-20-2018, 07:19 PM
  5. Set Variable = File Path generates "Object Required" Error
    By Brian48072 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2013, 11:42 AM
  6. [SOLVED] Excel 2007 : Help to Solve Run-time Error 424 "Object Required"
    By D.S.Rama Rao in forum Excel General
    Replies: 6
    Last Post: 03-05-2012, 03:24 PM
  7. "Microsoft Visual Basic runtime error '424' object required".
    By SharonG. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-04-2006, 08:40 PM

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