+ Reply to Thread
Results 1 to 5 of 5

Macro not running on protected worksheets

  1. #1
    Registered User
    Join Date
    09-30-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    18

    Macro not running on protected worksheets

    Hi All,
    I need help. I am using the following codes first to protect all worksheets and then I run the code to unprotect all sheets to make some corrections.
    When I run the Unprotect code after all worksheets have been protected, I am getting Run-time Error 1004 (all as hereunder.
    I know I am missing something. Would anyone know what this something is please?

    Thanks for help
    paraxis

    ' Macro to protect multiple sheets
    Please Login or Register  to view this content.
    Giving error
    Run-time Error '1004'
    The password you supplied is not correct. Verify that the CAPS LOCK key is off
    and be sure to use the correct capitalisation.
    Last edited by royUK; 11-12-2010 at 05:36 AM. Reason: add code tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro not running on protected worksheets

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro not running on protected worksheets

    I've added Code Tags for you.

    There's no problem with the code, where have you put the code?

  4. #4
    Registered User
    Join Date
    09-30-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Macro not running on protected worksheets

    Thanks for reply. I put the code to protect all sheets in Module1 and the code to unprotect all the sheets in Module2.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro not running on protected worksheets

    You could have them both in one module, but there's no reason for the error

+ Reply to Thread

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