Results 1 to 6 of 6

Ran Macro that Password Protected Sheets, Now won't Unprotect

Threaded View

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    New Jersey, USA
    MS-Off Ver
    Excel Mac 2011
    Posts
    3

    Ran Macro that Password Protected Sheets, Now won't Unprotect

    I ran the following Macro (written for the active workbook- to turn auto calculation on, password protect each worksheet and close/save the workbook) which worked just fine, however, when I try to un-protect any of the sheets, I end up with an Incorrect Password error. Please help - currently, I cannot edit any of the worksheets in this workbook. Apologies are offered in advance if I have broken any posting rules as this is my first post.

    Sub ActivateClose()
    
    Dim ws as WorkSheet
    
    Application.Calculation = xlCalculationAutomatic
    For Each ws in WorkSheets
    ws.Protect Password = "clean123"
    Next ws
    Exit For
    ActiveWorkbook.Close SaveChanges:=True
    
    End Sub
    Thanks for your help,

    PD
    Last edited by pjdumont; 05-05-2013 at 01:03 PM. Reason: Wrap Code per Forum Guidelines

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