+ Reply to Thread
Results 1 to 3 of 3

Unable to get the CheckBoxes Property of the WorkSheet class

  1. #1
    Registered User
    Join Date
    10-29-2014
    Location
    Sweden
    MS-Off Ver
    Windows 7
    Posts
    3

    Unable to get the CheckBoxes Property of the WorkSheet class

    Hi all

    I'm trying to hide rows in one sheet and hide a sheet by ticking a Checkbox. It all worked well untill I protected the Sheets and try to unprotect the adressed sheets with a macro. When un ticking the checkbox everything works well but when I Check it agen I get a error message 1004 stating "...Unable to get the CheckBoxes Property of the WorkSheet class"

    This is my code: (I'm farly new at this) Would be vary happy if someone would look at it.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Unable to get the CheckBoxes Property of the WorkSheet class

    Hi Controller 99,

    Your code worked for me after I deleted the following line which caused a compile error:
    Please Login or Register  to view this content.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    See the attached sample file.

    Lewis
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-29-2014
    Location
    Sweden
    MS-Off Ver
    Windows 7
    Posts
    3

    Re: Unable to get the CheckBoxes Property of the WorkSheet class

    Thanks Lewis

    I'll use the "Option Explicit" in the future.

    Controller 99

+ 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] unable to get the vlookup property of the worksheet function class
    By zak.horrocks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2014, 09:35 AM
  2. Unable to set the Visable property of the Worksheet class
    By ConradRichard in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2013, 03:34 PM
  3. Unable to get the ChartObjects property of the Worksheet class?
    By jrabenhorst in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2010, 02:46 PM
  4. Unable to set the visible property of the worksheet class
    By colinnwn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-09-2009, 03:48 PM
  5. Unable to get the dropdowns property of the worksheet class???
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-22-2006, 06:24 PM

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