+ Reply to Thread
Results 1 to 5 of 5

Sheet protection stops macro working.

  1. #1
    Forum Contributor
    Join Date
    05-20-2008
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    174

    Sheet protection stops macro working.

    I have a workboook that has three sheets.
    Two of these are protected and hidden.
    The third sheet is protected but has certain cells that can be amended by a third party. This third sheet also has a 'button' on it with a macro attached. Whilst in the protected mode, the macro will not run.

    Is there any way around this without unprotecting the sheet?

    I have realised that the macro is trying to adjust some of the protected cells so is the some code I can include in the macro that will unprotect the sheet and then re-protect it with the same password?
    Last edited by Andrew-Mark; 07-18-2009 at 10:09 AM. Reason: New info

  2. #2
    Registered User
    Join Date
    04-30-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sheet protection stops macro working.

    What if you write something like this in the module?!...

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-20-2008
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Sheet protection stops macro working.

    Cheers, progress has been made.

    That works if I have all the sheets visible.
    Is there no way the macro can run if any of the sheets it refers to are hidden?

  4. #4
    Registered User
    Join Date
    04-30-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sheet protection stops macro working.

    You should do the same unprotect/protect trick to all the sheets.
    Maybe this could help..

    Please Login or Register  to view this content.

  5. #5
    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: Sheet protection stops macro working.

    Quote Originally Posted by Andrew-Mark View Post
    That works if I have all the sheets visible. Is there no way the macro can run if any of the sheets it refers to are hidden?
    Provided the code the code does not attempt to select anything on the worksheet, the sheet need not be unhidden for the code to work.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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