+ Reply to Thread
Results 1 to 7 of 7

Macro will not work when sheet is Protected

Hybrid View

  1. #1
    Registered User
    Join Date
    05-27-2008
    Posts
    15

    Macro will not work when sheet is Protected

    Hi there guys, this is a followup to the same spreadsheet used in the following thread:

    http://www.excelforum.com/showthread...92#post1933992

    Hey guys, i have a question for the experts.

    I want to use Protection on this sheet to prevent the user from entering data in any spot, except for a few places.

    Unfortuntely, when I turn on the protection, the macro will not run. Is there anyway to have my sheet protected and let that macro run? Or am i forced to turn off protection and hope noone messes up the sheet? I already tried specifiying that sort and auto filter can be used by the user(by checking those check boses under Protection) but this did not solve issue

    Thanks

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    See Help for the UserInterfaceOnly argument for the Protect method.

  3. #3
    Registered User
    Join Date
    06-26-2008
    Location
    California
    Posts
    8
    Why not just have the protection turned off while the macro runs and the last line of code turns it back on


    Sub pwd
    ActiveSheet.UnProtect Password:="Password"
    
    "your code"
    
    ActiveSheet.Protect Password:="Password"
    
    end sub
    'Something like that...

  4. #4
    Registered User
    Join Date
    05-27-2008
    Posts
    15

    Protection

    Thanks for the help on this one. Sorry for such a easy question!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Sorry for such a easy question!
    That's where all of us began ...

  6. #6
    Registered User
    Join Date
    07-02-2008
    Location
    United States
    Posts
    23
    I'm new to these forums, and VBA in excel (but not VB in general).

    But, I'm wondering how the macro is going to run, and thereby disable protection, in the first place.

+ 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