+ Reply to Thread
Results 1 to 9 of 9

Manually Unprotecting a pre-protected Macro Enabled file.

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    Amritsar,Punjab,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Smile Manually Unprotecting a pre-protected Macro Enabled file.

    Hi Friends,

    I am exercising Macro coding in my home and have faced an issue. I have protected the worksheet with a blank password, but unable to unprotect the worksheet manually. Can anybody help me to solve this???

    All sorts of solutions and suggestions are most welcome.

    Regards,

    Apurv

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    If the password is "blank", you shouldn't need to input a password when you unprotect the sheet. But there's no message to say it is then unprotected.

    Or maybe you have used one or two spaces instead of a null string?

    Suggest you post the code you used to protect the sheet.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-25-2013
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    open the sheet in protected mode.

    then- save as - find folder, then hit the tools button(beside the save button in the popup)- general options - security

    should work for this application hopefully.

  4. #4
    Registered User
    Join Date
    01-09-2014
    Location
    Amritsar,Punjab,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    Hi TMShucks,

    Below is the macro code which I have used in the sheet with an Option Button.

    Public Sub OptionButton1_Click()
    ActiveSheet.Unprotect Password = ""
    Columns("F:AN").Select
    Selection.EntireColumn.Hidden = True
    Columns("E").Select
    Selection.EntireColumn.Hidden = False
    Range("C11").Select
    ActiveSheet.Protect Password = ""
    End Sub


    After saving the file, once i re-opened it and tried to un-protect the sheet manually but the same didn't happen, giving me the error as "The Password you supplied is not correct".

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    @miko.sims: workbook protection on save is nothing to do with worksheet protection.

  6. #6
    Registered User
    Join Date
    01-09-2014
    Location
    Amritsar,Punjab,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    Hi miko,

    Thanks for your suggestion. But please not that the file has been saved without any password and it is opening as well. I am facing issue in unprotecting the sheet. I have given the macro code which I am using for protecting the sheet.

    Rgrds,
    Apurv

  7. #7
    Registered User
    Join Date
    01-09-2014
    Location
    Amritsar,Punjab,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    Hi miko,

    Thanks for your suggestion. But please not that the file has been saved without any password and it is opening as well. I am facing issue in unprotecting the sheet. I have given the macro code which I am using for protecting the sheet.

    Rgrds,
    Apurv

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    Please Login or Register  to view this content.

    Regards, TMS

  9. #9
    Registered User
    Join Date
    01-09-2014
    Location
    Amritsar,Punjab,India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    Hi TMS,

    Thanks for your valuable help. The coding helped me a lot. However there was a minor addition from my end. Giving here the exact code that helped me a lot.

    Thanks Once Again.

    Regards,
    Andy.


    Public Sub OptionButton1_Click()
    ActiveSheet.Unprotect Password:=""
    Columns("F:AN").EntireColumn.Hidden = True
    Columns("E").EntireColumn.Hidden = False
    Range("C11").Select
    ActiveSheet.Protect Password:=""
    End Sub

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Manually Unprotecting a pre-protected Macro Enabled file.

    To be fair, I just copied and modified your code. I caught the first missing colon ( but missed the other one.


    But, you're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Macro Enabled File
    By caracadon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2014, 03:14 PM
  2. File name won't change when macro is enabled
    By debbiesh in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2012, 04:26 PM
  3. How to make macro enabled worksheet functional in protected worksheet?
    By promo786 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2011, 03:24 PM
  4. Macro Enabled file too larg
    By stydielax14 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-19-2011, 05:23 PM
  5. Want user to select macro enabled manually
    By vivekdevkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2010, 07:22 AM

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