+ Reply to Thread
Results 1 to 6 of 6

Unprotect/Protect Workbook Structure

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

    Unprotect/Protect Workbook Structure

    Hey everyone,

    I am using 2 sheets to balance confidential data: The workbook structure is protected I want to be able to unprotect the book, make one sheet visable and then make the sheet that was previously visible hidden, then protect the book again. Cant get my code to work though. Can anyone help?


    Please Login or Register  to view this content.
    Last edited by Spear86; 04-28-2014 at 04:27 AM.

  2. #2
    Registered User
    Join Date
    05-23-2013
    Location
    California, USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Unprotect/Protect Workbook Structure

    You will need to use an "If Then" statement to test which sheets are visible versus hidden, then change the properties to the opposite values for those worksheets.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Unprotect/Protect Workbook Structure

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    01-10-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Unprotect/Protect Workbook Structure

    @Kelleytr, I should not require a if then statement as there is a command button on both pages allowing them to switch so i have code on each one.

    @shg with that I am getting run-time error '438' - stating object does not support method on that.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Unprotect/Protect Workbook Structure

    I don't think you can have copied shg's code correctly - it works as posted.
    Remember what the dormouse said
    Feed your head

  6. #6
    Registered User
    Join Date
    01-10-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Unprotect/Protect Workbook Structure

    Thanks managed to get it to work it was the Spacing on my sheet for CEL (2)

+ 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. Replies: 0
    Last Post: 03-12-2013, 02:33 AM
  2. [SOLVED] Uploading data to a protect workbook; Unprotect workbook
    By pinstripe05 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-02-2013, 06:07 PM
  3. [SOLVED] VBA to protect & unprotect workbook
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2012, 07:39 AM
  4. [SOLVED] Protect & unprotect sheet and workbook
    By Ignesh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2012, 05:54 AM
  5. Protect/Unprotect a Workbook with code
    By RevJeff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2012, 10:22 AM

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