Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Neo1
 
Posts: n/a
Default Protecting Workbook!..


Hello, I want to make sure that my workbook doesnt close until every
single sheet is protected if any worksheet is left unprotected then the
user must protect it before being able to close the workbook, How can i
do this...possibly showing an error message too...

Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=531466

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Protecting Workbook!..

If you name a macro beforeClose() this run before the workbook closes.
You can then put the code in here to make the sheets protected.

Thanks
Paul

"Neo1" wrote:


Hello, I want to make sure that my workbook doesnt close until every
single sheet is protected if any worksheet is left unprotected then the
user must protect it before being able to close the workbook, How can i
do this...possibly showing an error message too...

Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=531466


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Neo1
 
Posts: n/a
Default Protecting Workbook!..


I dont understand, can you explain it to me step to step please

Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=531466

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Protecting Workbook!..

John
Put the code below in the Thisworkbook not in a normal module in the VBA
editor.
If you want I can email you the file
Thanks
Paul

Private Sub Workbook_BeforeClose(Cancel As Boolean)
sh = Worksheets.Count

For n = 1 To sh
Sheets(n).Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Next n

End Sub

"Neo1" wrote:


I dont understand, can you explain it to me step to step please

Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=531466


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
Repost:Automatically inserting a row in external workbook 50pingviner Excel Discussion (Misc queries) 3 December 28th 05 07:38 PM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Auto updating a workbook with data from another workbook Richard Excel Discussion (Misc queries) 0 November 6th 05 03:50 PM
Protecting A Workbook from being saved/written over Lauren Excel Discussion (Misc queries) 2 June 27th 05 06:24 PM
How to hyperlink from a workbook to sheets in another workbook? MJOHNSON Excel Worksheet Functions 0 February 17th 05 08:31 PM


All times are GMT +1. The time now is 04:55 PM.

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"