+ Reply to Thread
Results 1 to 3 of 3

Code to Unprotect a Workbook

  1. #1
    Forum Contributor
    Join Date
    04-15-2008
    Location
    Texas, USA
    MS-Off Ver
    M365 Excel Version 2210
    Posts
    198

    Code to Unprotect a Workbook

    I recorded the following code to Unprotect an entire Workbook yet VBA tells me that the code has an error "Compile error: Expected: end of statement". Also, once we get the error corrected, how do I change this line of code since the workbook is password protected?

    Please Login or Register  to view this content.
    Thanks for your help,
    RR

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Code to Unprotect a Workbook

    There is only one parameter for the Unprotect method

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Code to Unprotect a Workbook

    Change the password to suit.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Unprotect Excel 2010 workbook - not a shared workbook
    By kisboros in forum Excel General
    Replies: 1
    Last Post: 01-08-2015, 06:51 PM
  2. [SOLVED] Uploading data to a protect workbook; Unprotect workbook
    By pinstripe05 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-02-2013, 06:07 PM
  3. Protect/Unprotect a Workbook with code
    By RevJeff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2012, 10:22 AM
  4. Protect/Unprotect code causing out of range error in code
    By Petrolcb41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2010, 02:34 PM
  5. Unprotect Workbook VBA code
    By StevieF8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2007, 06:55 AM
  6. [SOLVED] Generic protect/unprotect code through buttons and code?
    By StargateFanFromWork in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-02-2006, 03:35 PM
  7. Unprotect Workbook
    By Kent in forum Excel General
    Replies: 1
    Last Post: 02-03-2005, 10:06 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