+ Reply to Thread
Results 1 to 8 of 8

Unlock whole workbook by putting the password in a cell in 2010

  1. #1
    Registered User
    Join Date
    03-21-2014
    Location
    Eastleigh, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Question Unlock whole workbook by putting the password in a cell in 2010

    Hi, I'm not new to Excel but I'm quite new to actually doing anything with it and I'd like to get a handle on some of the better fetaures available.

    I'd like to be able to unlock the whole of a workbook by putting the password into a specific cell and then the whole thing locks again when it is saved. I have been able to find the coding to do this for a worksheet but I'd really like to be able to unlock the whole project. Please help

    Thanks & regards,
    Andy

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Unlock whole workbook by putting the password in a cell in 2010

    Google Excel Workbook Unprotect VBA, this should explain how to do it, its only 1 line of code.

    Record yourself doing it, which would be quicker.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Unlock whole workbook by putting the password in a cell in 2010

    This will protect all sheets of that workbook. Replace Protect to Unprotect to unprotect all sheets of that workbook

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    03-21-2014
    Location
    Eastleigh, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Unlock whole workbook by putting the password in a cell in 2010

    Ok cool, thanks guys, I've tried:

    Please Login or Register  to view this content.
    This is somewhere near what I'd like but I'd like the password fixed in the code, so I'm not putting it in everytime I want to protect the sheet, I just simply save and the workbook is locked again. Can it be added as a line in the code? I have tried making UnprotectPW = to "Andy" but that didn't work

    Also, if the password is incorrect it returns a runtime error can error handling be used to make it simply tell you that and close the message box?

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Unlock whole workbook by putting the password in a cell in 2010

    Yes, error handling will do what you need, and setting the variable to be Andy should also work.

  6. #6
    Registered User
    Join Date
    03-21-2014
    Location
    Eastleigh, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Unlock whole workbook by putting the password in a cell in 2010

    This is kind of going past my capabilities at the moment, is there any good, preferably cheap learning tools I can get hold of?

  7. #7
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Unlock whole workbook by putting the password in a cell in 2010

    Yes, GOOGLE

    Google error trapping vba and unprotecting workbook using vba

  8. #8
    Registered User
    Join Date
    03-21-2014
    Location
    Eastleigh, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Unlock whole workbook by putting the password in a cell in 2010

    Google is fantastic! How d'you think I found this forum?!? I've read, learnt and tried loads of basics already

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Marco to unlock my password protected workbook.
    By 11linc11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2013, 07:44 PM
  2. unlock a password locked workbook!!!
    By richardeallen in forum Excel General
    Replies: 1
    Last Post: 06-06-2007, 12:57 PM
  3. Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  4. Replies: 1
    Last Post: 06-24-2005, 09:59 AM
  5. Replies: 1
    Last Post: 06-23-2005, 09:05 PM

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