+ Reply to Thread
Results 1 to 5 of 5

Error 1004 when no sheets are protected

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Error 1004 when no sheets are protected

    On opening a rather large workbook project i get Error 1004 telling me that i cannot use this command on a protected workbook.

    I open the editor, click the Run arrow, and it runs just fine from where it stopped.

    For the heck of it, just before the line where the VBE shows highlighted, i threw in code to unprotect every single worksheet in the workbook. Nope. Still halts upon opening at the same spot, i click DeBug, either hit the Run arrow or F5, and all continues fine.

    Any thoughts on this behavior (other than it's annoying)?

    Thank-you everyone!!!

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Error 1004 when no sheets are protected

    i threw in code to unprotect every single worksheet in the workbook
    Sounds like the workbook itself is protected. Have a look at the Protect tab of the Review ribbon - I'm guessing it's saying Unprotect Workbook?
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: Error 1004 when no sheets are protected

    Unfortunately not - the WorkBook is verified as Unprotected. That it would run after halting by my telling it to run again without any other modifications, i suspect Excel has to catch up with itself in its processing of commands, but i tried throwing in a loop to stall it a bit prior to the line it stops on, but that didn't open it up. Maybe instead of a 1 to 1000 i best try something lengthier or call in a Wait or a Pause...

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Error 1004 when no sheets are protected

    I won't think so but I could be wrong. Maybe you have two (or more) workbooks open and the code is trying to run on one of those (which is protected) instead of the indented workbook?

    If not, can you attach the workbook (devoid of all sensitive data) so we can have a look?
    Last edited by Trebor76; 12-03-2018 at 11:12 PM.

  5. #5
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: Error 1004 when no sheets are protected

    Thank-you! I will see what i can do-

+ 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. paste value into protected sheet error 1004
    By padob in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-20-2017, 06:21 AM
  2. 1004 error in protected view
    By Cornhillfarm in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-28-2016, 07:36 AM
  3. Error:1004 When Password Protected VBA
    By Gopal Veeranala in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2012, 12:14 PM
  4. Run-time error '1004' ... But only when the worksheet is protected?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-07-2012, 06:22 AM
  5. VB run time error 1004 on protected sheet
    By Twaddy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2010, 05:07 PM
  6. Protected sheets w/macros giving runtime error 1004
    By cedarhill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2009, 07:59 AM
  7. Run-time error 1004 when sheet is protected
    By AJ. in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-05-2008, 10:33 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