+ Reply to Thread
Results 1 to 10 of 10

Temperamental Macro's: Errors occur if any changes are made

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Temperamental Macro's: Errors occur if any changes are made

    This is driving me mad.

    I have a series of Macro's which, thanks to some help from this forum, were working perfectly.

    An example:
    Please Login or Register  to view this content.
    The Macro checks that at least one check-box in a range has been ticked, and returns an error if that is not the case.
    However. If I attempt to replicate this Macro but for a different range of check-boxes, by copying the code into a new module and changing the numbers, I.e
    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.
    I suddenly am getting an error message(s):

    Unable to get the value property of the checkbox class.
    OR
    method checkboxes of object _worksheet failed

    What has changed!?

    I have a feeling there is something going on around where my macro's are saved and stored. But it doesn't work even if the module is hosted in my Personal.xls file.

    I would really appreciate it if somebody could shed light on this for me. This place is becoming like my second home...

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Are the checkboxes all of the same type?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: Temperamental Macro's: Errors occur if any changes are made

    Quote Originally Posted by Norie View Post
    Are the checkboxes all of the same type?
    Interesting point - but none of them have =EMBED (or whatever it is for ActiveX) - So I think they're all Form control

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    You asked a question 'What has changed?".

    Can I ask a slightly different question?

    What's different about the checkboxes/code that's causing the errors?

  5. #5
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: Temperamental Macro's: Errors occur if any changes are made

    Quote Originally Posted by Norie View Post
    You asked a question 'What has changed?".

    Can I ask a slightly different question?

    What's different about the checkboxes/code that's causing the errors?
    So the other range of check-boxes is much bigger and in a jumbled order, presumbly because I copied and pasted them to generate new ones.

    I suppose it's possible that even though the boxes cover the range number 653 - 694, there may be one number in the middle of the range which is missing.

    However, to illustrate my query whether it was macro location:

    When RomperStomper helped me adjust my code to make it work, he said 'It now works'.
    I tried it in my client sheet, and came back with 'No it doesn't'
    He then came back and said 'yes it does'

    So I started a new workbook, created 5 check-boxes, pasted in the code, and hey it worked.

    So it seems to be something about my current workbook
    Last edited by henryBukowski; 08-21-2013 at 08:24 AM.

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

    Re: Temperamental Macro's: Errors occur if any changes are made

    Are you sure you have the correct names for the checkboxes, and that you haven't grouped any controls?
    Remember what the dormouse said
    Feed your head

  7. #7
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: Temperamental Macro's: Errors occur if any changes are made

    Quote Originally Posted by romperstomper View Post
    Are you sure you haven't grouped any controls?
    Hello again,

    I'm unsure what you mean? However, I have grouped all the check-boxes so that if one moves the others move and they all stay together, like you would want in a user/client form.

    Is this a big no-no?

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Temperamental Macro's: Errors occur if any changes are made

    That is almost certainly why you can't read the values, unfortunately.

  9. #9
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: Temperamental Macro's: Errors occur if any changes are made

    It wouldn't be a massive deal if there was an alternate way to make sure the boxes don't get moved around?

    Ultimately I want people to be able to check or uncheck the boxes, but not move around or resize - if there was another way to do this, I wouldn't mind at all about not grouping them.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Temperamental Macro's: Errors occur if any changes are made

    You could protect the worksheet, or use a userform, or use an alternative to checkboxes (e.g. a Marlett font applied to cells).

+ 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. Can a macro be made for this?
    By jbj9267 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2013, 04:03 AM
  2. Replies: 5
    Last Post: 04-16-2012, 08:12 PM
  3. Excel Charts made from "My Templates" Causing Errors
    By heywhat in forum Excel General
    Replies: 0
    Last Post: 03-15-2012, 02:14 PM
  4. Restrict Workbook_SheetSelectionChange to only occur after another macro has finished
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2012, 08:23 PM
  5. [SOLVED] Why errors occur in wrkbook w/ vba when saved on Shared folder?
    By Shawna Hartman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2006, 11:40 AM

Tags for this Thread

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