+ Reply to Thread
Results 1 to 4 of 4

Thread: Running Macro on Protected Sheets

  1. #1
    Registered User
    Join Date
    05-09-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Question Running Macro on Protected Sheets

    Hi,

    I am currently struggling with the following problem, any assistance greatly appreciated!

    I have a workbook with existing macros & formula. Due to getting corrupted by non trained users I have had to repair & protect the workbook. However, with the sheets protected one of the macros will not run. I have managed to get it to un-protect the sheet OK, but it seems to re-protect the sheet too fast at the end of the process giving a Run-time error '1004'. This is with putting ActiveSheet.UnProtect at the beginning of the macro code & ActiveSheet.Protect at the end. If I leave off the Protect at the end of the code, it runs OK, but obviously leaves the sheet un-protected!

    Thanks in anticipation.....

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: Running Macro on Protected Sheets

    can't help without seeing the code& possibly an example workbook
    Last edited by royUK; 05-09-2010 at 12:57 PM.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  3. #3
    Registered User
    Join Date
    05-09-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Running Macro on Protected Sheets

    Hi,

    Thanks for the interest, as usual I have been struggling with this all weekend, then I post a question & then find the answer myself!

    Problem solved.

    Thanks again,

    What's it doing

  4. #4
    Registered User
    Join Date
    05-09-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Running Macro on Protected Sheets

    problem solved
    Last edited by What's it doing; 05-09-2010 at 01:27 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0