Closed Thread
Results 1 to 7 of 7

Protect Workbook / Worksheets

  1. #1
    Registered User
    Join Date
    02-23-2008
    Posts
    14

    Protect Workbook / Worksheets

    I have an Excel workbook that runs a macro to update data on lots of different spreadsheets within the workbook from an external database (pivot tables). This workbook is in a shared area so that it can be used by many different people. My problem is that i need to protect the workbook / worksheets from modification when not being updated; but allow the macro updates to take place when the macro is running. Basically I want to stop people messing around with the workbook and its worksheets but allow the updates via an update button they use to run the update Macro. Hope this makes sense. Would appreciate any ideas and thoughts on this.

    Regards

    StudentMod

  2. #2
    Forum Contributor
    Join Date
    06-14-2008
    Posts
    153
    Hi,

    Enter this code in the worksheet activate event.
    Please Login or Register  to view this content.
    This will protect the user interface only, and allow the macro to make updates.

    Regards.
    Welcome to: http://www.exceldigest.com/myblog/
    "Excel help for the rest of us"

  3. #3
    Registered User
    Join Date
    02-23-2008
    Posts
    14
    Thank you. Will this protect the worksheets from users who try to change cells when the macro has stopped running ?

    Regards

    StudentMod

  4. #4
    Forum Contributor
    Join Date
    06-14-2008
    Posts
    153
    Hi,

    The protection will remain intact unless someone unprotect the sheet. All this statement is doing, is exempting the macro from the protection. You can test this for yourself.
    I have written a couple of post on protection, if you are interested. Here is a link.
    http://www.exceldigest.com/myblog/category/protection/

    Regards.

  5. #5
    Registered User
    Join Date
    02-23-2008
    Posts
    14
    Will give it a go. Many thanks for your help.

    Best Regards

    StudentMod

  6. #6
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Protect Workbook / Worksheets

    I have a similar problem with my workbook where do I put the line of code and how?

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

    Re: Protect Workbook / Worksheets

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Hope that helps.

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

    Free DataBaseForm example

Closed 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