+ Reply to Thread
Results 1 to 4 of 4

password protect macro

  1. #1
    Modell
    Guest

    password protect macro

    How do I run a macro that will unprotect the sheet by entering the password,
    run the macro, and then password protect the sheet again by re-entering the
    password after the macro runs so users are not able to tamper with the data
    in the spreadsheet?

    I get an error when I try this with an actual password, but it works if I
    protect the sheet without a password.

    Thanks for your help.

  2. #2
    AidanH
    Guest

    Re: password protect macro

    should work fine - see

    ActiveSheet.Protect Password = "FRED"
    ActiveSheet.Unprotect Password = "FRED"


    which (rather pointlessly) protects and unprotects a sheet without
    doing anything else


  3. #3
    Modell
    Guest

    Re: password protect macro

    Thanks Aidan. It works, but for some reason when I try to unprotect the
    worksheet from Excel and put in the password it's telling me that my password
    is incorrect. When I run the macro which protects and unprotects the
    worksheet with the password it works fine. Any thoughts?

    "AidanH" wrote:

    > should work fine - see
    >
    > ActiveSheet.Protect Password = "FRED"
    > ActiveSheet.Unprotect Password = "FRED"
    >
    >
    > which (rather pointlessly) protects and unprotects a sheet without
    > doing anything else
    >
    >


  4. #4
    Heather Heritage
    Guest

    Re: password protect macro

    (AidanH replying from home!) - I would GUESS that the sheet is already
    protected with a password different from the one you expect (perhaps CAPS
    instead of caps - these are different to Excel you see)

    "Modell" <Modell@discussions.microsoft.com> wrote in message
    news:DA2DF61C-0834-497A-A558-DCC5AB9DD597@microsoft.com...
    > Thanks Aidan. It works, but for some reason when I try to unprotect the
    > worksheet from Excel and put in the password it's telling me that my

    password
    > is incorrect. When I run the macro which protects and unprotects the
    > worksheet with the password it works fine. Any thoughts?
    >
    > "AidanH" wrote:
    >
    > > should work fine - see
    > >
    > > ActiveSheet.Protect Password = "FRED"
    > > ActiveSheet.Unprotect Password = "FRED"
    > >
    > >
    > > which (rather pointlessly) protects and unprotects a sheet without
    > > doing anything else
    > >
    > >




+ 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