Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to have workbook automatically protect when closed (or opened)
Hi,
I have a spreadsheet (MS Excel 2003) that is currently shared over a network among many users. Currently, we have some columns protected from editing. However, some of the user base who edit the sheet and have the password tend to not protect the workbook again after they are doing edits (managers). Anyone know of a macro or other method that would have the workbook automatically be protected, even if it was saved unprotected? Possibly protected on close/open, or on save? Thanks, Drew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to have workbook automatically protect when closed (or opened)
Paste this into the ThisWorkbook Module
Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Replace "Password" with your password that you use 'this will set password when closing workbook ActiveSheet.Protect "Password", True ActiveWorkbook.Protect "Password", True End Sub " wrote: Hi, I have a spreadsheet (MS Excel 2003) that is currently shared over a network among many users. Currently, we have some columns protected from editing. However, some of the user base who edit the sheet and have the password tend to not protect the workbook again after they are doing edits (managers). Anyone know of a macro or other method that would have the workbook automatically be protected, even if it was saved unprotected? Possibly protected on close/open, or on save? Thanks, Drew |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to have workbook automatically protect when closed (or opened)
On May 16, 1:04 pm, Mike wrote:
Paste this into the ThisWorkbook Module Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Replace "Password" with your password that you use 'this will set password when closing workbook ActiveSheet.Protect "Password", True ActiveWorkbook.Protect "Password", True End Sub " wrote: Hi, I have a spreadsheet (MS Excel 2003) that is currently shared over a network among many users. Currently, we have some columns protected from editing. However, some of the user base who edit the sheet and have the password tend to not protect the workbook again after they are doing edits (managers). Anyone know of a macro or other method that would have the workbook automatically be protected, even if it was saved unprotected? Possibly protected on close/open, or on save? Thanks, Drew Wow, awesome thanks for the quick response, works perfectly~ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel opened by program and closed by user | Excel Programming | |||
Run macro when file is opened and closed | Excel Programming | |||
charting closed vs opened orders | Charts and Charting in Excel | |||
How do I protect a worksheet from being opened inside a workbook | Excel Discussion (Misc queries) | |||
save Wsh to closed/opened WB | Excel Programming |