+ Reply to Thread
Results 1 to 7 of 7

How to protect entire excel workbook with running macros?

  1. #1
    Registered User
    Join Date
    12-26-2012
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    18

    How to protect entire excel workbook with running macros?

    I have an excel file with macros running thru the entire workbook. When I protect the workbook all macros stop running. Can anyone help? I want protect the workbook and only allow users to enter data in certain required fields.


    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 01-26-2013 at 02:20 PM. Reason: Added code tags, as per forum rules. Don't forget!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to protect entire excel workbook with running macros?

    Your macro will need to

    1) Unprotect the sheet
    2) Turn off all self-activating macros temporarily
    3) Do it's stuff
    4) Protect the sheet again
    5) Turn other macros back on

    Please Login or Register  to view this content.

    I've also added a much shorter syntax for hiding/unhiding rows with single lines of code that act light light switches.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-26-2012
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: How to protect entire excel workbook with running macros?

    Not sure what I'm doing wrong but it still does not work. Attached is the document I'm trying to protect.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to protect entire excel workbook with running macros?

    Not sure what you want us to do with a file completely locked down that way and no instructions...

  5. #5
    Registered User
    Join Date
    12-26-2012
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: How to protect entire excel workbook with running macros?

    Sorry not sure why the file didn't open for you. I re attached the file.
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to protect entire excel workbook with running macros?

    I can view the file just fine, but you're posting a locked file.

    http://screencast.com/t/QhHcxOrk

  7. #7
    Registered User
    Join Date
    12-26-2012
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: How to protect entire excel workbook with running macros?

    That's so weird. I tried opening the file that was uploaded and its locked. Just sent the file to your email address. Something is affecting the file when it is uploaded. I don't have any lock on the file.

+ 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