+ Reply to Thread
Results 1 to 4 of 4

ActiveX Control Button in Protected Worksheet - Excel 2010

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Red face ActiveX Control Button in Protected Worksheet - Excel 2010

    Hey

    I am a beginner at this so please excuse a seemingly silly question but I have activex control buttons which hide and unhide certain rows, however once I protect the worksheet I receive the following error:

    Run-time error '1004':
    Unable to set the Hidden property of the Range class.

    This is the VBA Code:

    Private Sub CheckBox1_Click()

    End Sub

    Private Sub CommandButton1_Click()
    With Rows("24:30")
    .Select
    .EntireRow.Hidden = Not .EntireRow.Hidden
    End With
    End Sub

    Private Sub CommandButton2_Click()
    With Rows("31:36")
    .Select
    .EntireRow.Hidden = Not .EntireRow.Hidden
    End With
    End Sub

    Private Sub CommandButton3_Click()
    With Rows("48:57")
    .Select
    .EntireRow.Hidden = Not .EntireRow.Hidden
    End With
    End Sub

    Any ideas? Thank you in advance!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: ActiveX Control Button in Protected Worksheet - Excel 2010

    Unprotect the sheet, do whatever you have to do, protect the sheet. Something like this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-07-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: ActiveX Control Button in Protected Worksheet - Excel 2010

    Thank you, that's fantastic.

    My 'design mode' in the developer still active even in the protected sheet. Is there any way to change this?

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: ActiveX Control Button in Protected Worksheet - Excel 2010

    Turn design mode off.

+ 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] MonthlyView ActiveX Control: How to add Pop Up Calendar in Excel 2010 in specific cell
    By sofib09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2013, 12:28 PM
  2. Excel 2010 Combo box ActiveX control for the whole matrix table
    By Jungl3b0y in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-29-2012, 01:21 AM
  3. ActiveX control not working in Excel 2010
    By vbtryhard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2011, 08:19 AM
  4. Excel 2010 ActiveX Control Disabled in Shared Workbook
    By moorelgm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-15-2010, 12:03 AM
  5. macro assigned to a form control button in a protected worksheet
    By lee_har in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2009, 02:29 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