+ Reply to Thread
Results 1 to 3 of 3

Create Password Protection with a macro

Hybrid View

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Create Password Protection with a macro

    Hi,

    I have a macro written, and I when it starts I would like it to unprotect the sheet, then at the end protect the sheet with a password. Currently I have this to unprotect:

    ActiveSheet.Unprotect
    and to protect the sheet at the end I have

    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    But how do I create a macro to protect the sheet using a password?

    Thanks
    KC
    Last edited by King_Crud; 11-08-2011 at 10:17 AM. Reason: correct tags

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,997

    Re: Create Password Protection with a macro

    It's just:
    ActiveSheet.Protect Password:="some password", DrawingObjects:=True, Contents:=True, Scenarios:=True
    Note: I altered your QUOTE tags to CODE tags.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Create Password Protection with a macro

    Thanks very much!

+ 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