Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel opened by program and closed by user [email protected] Excel Programming 2 March 23rd 07 02:24 AM
Run macro when file is opened and closed mcphc Excel Programming 2 February 20th 07 11:32 AM
charting closed vs opened orders yannb Charts and Charting in Excel 1 October 4th 05 03:41 AM
How do I protect a worksheet from being opened inside a workbook J. Robinson Excel Discussion (Misc queries) 2 June 1st 05 03:40 PM
save Wsh to closed/opened WB helmekki[_45_] Excel Programming 1 October 25th 04 08:28 PM


All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"