+ Reply to Thread
Results 1 to 9 of 9

error messages from check box code...

  1. #1
    Registered User
    Join Date
    08-27-2007
    Posts
    48

    error messages from check box code...

    Hi,
    I am trying to use a check box in an excel sheet. However, this line of code:

    Please Login or Register  to view this content.
    produces the following error: Runtime error 424 - object required.
    Why does Excel not recognise the check box as an object?

    If I change the code to:
    Please Login or Register  to view this content.

    The following error is returned: "Runtime error 438 - Object doesn't support thid property or method"

    - what's going on? The correct sheet is selected, and the "Microsoft DAO 3.6 object library" is selected under references...

    Lotte
    Last edited by VBA Noob; 10-24-2007 at 03:24 AM.

  2. #2
    Registered User
    Join Date
    09-24-2007
    Posts
    6
    modify code like this

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 10-24-2007 at 03:24 AM.

  3. #3
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    The code
    Please Login or Register  to view this content.
    does not exist. As mentioned, you can use
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-27-2007
    Posts
    48
    Thanks for the suggestions.

    The

    Please Login or Register  to view this content.

    line produces the following error:

    "Run-time error 438 - Object doesn't support this property or method"

    Any ideas?
    Last edited by VBA Noob; 10-24-2007 at 03:24 AM.

  5. #5
    Registered User
    Join Date
    09-24-2007
    Posts
    6
    be sure of the name of check box in your activesheet is "CheckBox2".

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Can you post the full code?

  7. #7
    Registered User
    Join Date
    08-27-2007
    Posts
    48
    Hi,
    The code is shown below. The name if the check box is correct - I checked by creating a new check box and a new macro - same problem. I am usinhg Excel 2003 without SPs - could this be the problem ?
    Lotte

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 10-24-2007 at 03:23 AM.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Lottesfog,

    There are 2 types of check boxes, the Forms type, and the Control Toolbox type. The code given so far is for the Control Toolbox type. Since it isn't working, I am betting you have a Forms type control. Try this code...
    Please Login or Register  to view this content.
    To "UnCheck" a Forms check box, you must set the value to the constant xlOff. Setting it to False or 0 will not work.

    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 09-25-2007 at 12:32 AM.

  9. #9
    Registered User
    Join Date
    08-27-2007
    Posts
    48
    Hi Leith,
    Thank you - you are correct, I was using the form type check box.
    The check box appears in an excel sheet where a user should be able to check it (and thereby run a macro).
    As far as i can see, the form type check box can be ticked by a user but is not easy to code with - and the control type check box can't be checked by the user - is that correct?

    using the code you suggested:

    Please Login or Register  to view this content.

    produces the following error:
    "un-time error 1004 - Unable to get checkboxes proterty of the worksheet class."

    My main question now is whether, for a check box in an excel sheet which should be checked by the user, the form type or the control type would be best?

    Lotte
    Last edited by VBA Noob; 10-24-2007 at 03:23 AM.

+ 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