How do I include my password in a macro?

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: How do I include my password in a macro?

  1. #1
    Board Regular Barry Katcher's Avatar
    Join Date
    Feb 2002
    Location
    Dog Beach, Florida. Yeaahh!
    Posts
    4,053
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I have a workbook that is used by several end-user with sheets that are password protected so they can't overwrite formulas. I have a button which runs a macro that I recorded that unprotects the sheet, performs several other operations, and then protects the sheet again.

    The problem is, that when the macro is run by the end-user, it stops and a drop-down box asks for the password to be entered to unprotect. Obviously, it would be defeating the purpose to give the users the password.

    My question is: is there any code I can insert in the macro to automatically enter my password in the box to unprotect, and once again, enter it twice to re-protect?

    Thanx in advanx.
    Barry-

    Photo Restoration/Enhancement

    http://www.smiledogproductions.com
    click below for detour


  2. #2
    Board Regular
    Join Date
    Aug 2002
    Posts
    210
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sheets(sheet1).Unprotect Password:="B_2"

    Sheets(sheet1).Protect Password:="B_2"



  3. #3
    Board Regular Barry Katcher's Avatar
    Join Date
    Feb 2002
    Location
    Dog Beach, Florida. Yeaahh!
    Posts
    4,053
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thanks, B_2. The migraine I've had the past 6 months has suddenly cleared up.
    Barry-

    Photo Restoration/Enhancement

    http://www.smiledogproductions.com
    click below for detour


User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com