+ Reply to Thread
Results 1 to 6 of 6

Lock and unlock page within viewode

  1. #1
    Registered User
    Join Date
    12-22-2019
    Location
    British Columbia
    MS-Off Ver
    Office 2019
    Posts
    8

    Lock and unlock page within viewode

    Greetings,

    Is there a way to unlock a page, run a page macro, then lock it again, all within a sheet view code?

    I currently have the code working perfectly whenever the sheet becomes active, but would like to protect its contents while it’s open unless I manually unlock it

    If I lock it and scroll away then back, I get an error code.

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Lock and unlock page within viewode

    It's not clear (to me at least) what exactly you mean.

    You have working code that runs when you activate a sheet? Then why do you need to unprotect the sheet at all?

    Beth.

  3. #3
    Registered User
    Join Date
    12-22-2019
    Location
    British Columbia
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Lock and unlock page within viewode

    Because the data is being populated from another sheet, I wish to prevent someone from making changes in the sheet, it’s more of a double security and makes sure work is not done or wasted in the wrong area......

    But if I manually lock those sheets, then navigate away, then back.... I get a debug error.

    I am trying to make it more user simple..... I might be asking too much of the program, but the vision is correct

  4. #4
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Lock and unlock page within viewode

    Could you not have code unprotect the sheet, do what it does, then reprotect the sheet? That way it wouldn't be unprotected long enough for anyone to make any changes.

    Or, you could set the protection on the sheet with the UserInterfaceOnly property set to True during the workbook open event. That way the code can manipulate the sheet but the user cannot.

    It would be easier to give a more specific answer on the debug error if we knew what the code was, or even better if we could see the file (a desensitized version of).

    Beth.

  5. #5
    Registered User
    Join Date
    12-22-2019
    Location
    British Columbia
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Lock and unlock page within viewode

    That’s what I want, but when I’ve tried writing the code to booked the working code, I get an debug error

  6. #6
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Lock and unlock page within viewode

    And if you show us the code / file, perhaps we can help with that debug error...

    Beth.

+ 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. Lock Unlock Row
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2012, 03:57 PM
  2. Excel Lock & Unlock
    By sugavanam in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-30-2011, 10:28 AM
  3. Lock/Unlock some cells in a row
    By processchip in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2011, 01:05 PM
  4. Lock or unlock cell in vba
    By peejay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-26-2007, 05:34 PM
  5. lock/unlock cells
    By john tempest in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-16-2006, 03:55 PM
  6. Lock and Unlock Cells
    By Peter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-29-2005, 01:06 PM
  7. [SOLVED] Lock and Unlock cells using VBA
    By Peter in forum Excel General
    Replies: 1
    Last Post: 01-29-2005, 10:06 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