+ Reply to Thread
Results 1 to 2 of 2

protect all worksheets on save event

  1. #1
    Registered User
    Join Date
    12-20-2015
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    9

    protect all worksheets on save event

    Hi all,

    i whant to perform protection to all worksheets on the event of saving workbook,
    having office 2010.

    this is an easy enough task to execute:
    on triger workbook_beforesave i am calling ProtectAllSheets sub,


    Please Login or Register  to view this content.
    this sub works well when the user press ctrl+S to save the workbook,
    but when i write a command to save the workbook:
    thisworkbook.save
    goes crazy, the unprotect and protect commands does nothing

    any advice?


    Gil
    Last edited by GilEytan; 08-22-2017 at 02:00 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: protect all worksheets on save event

    Just before the 'thisworkbook.save' put 'ProtectAllsheets'.

+ 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. Need Event Procedure to Unlock a Protect Cell if Criteria is Met
    By MaineLabRat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2017, 02:50 PM
  2. Macro to Hide Most Worksheets, Protect Workbook, Save a Copy
    By brendangroff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2016, 02:40 PM
  3. [SOLVED] Unprotect/Protect worksheets between start/end worksheets
    By thebutlerdidit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2015, 03:14 PM
  4. [SOLVED] Event Change code to protect formula if data entered manually
    By Chron6767 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2014, 06:52 PM
  5. Protect/Unprotect as an event??
    By MontySmall in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2013, 11:03 AM
  6. Selectionchange event to protect cells
    By jman0707 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2008, 10:17 PM
  7. Event macro to Protect all sheets on workbook save
    By zhuanyi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2008, 12:29 AM

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.6.0 RC 1