Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
KandK
 
Posts: n/a
Default PASSWORD PROTECT BEFORECLOSE

Tristan was kind enough to enlighten me into using Visual Basic Editor to
have a message box asking Are you sure you want to close? when someone tries
to close a workbook. However it would be great if I could password protect
the closing of a workbook. This is the first time I have used Visual Basic
Editor so with my very limited experience and Microsoft Excel Help I could
not work out a way. So if anyone has any suggestions or could even tell me it
is not possible it would be greatly appreciated. Many thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Ogilvy
 
Posts: n/a
Default PASSWORD PROTECT BEFORECLOSE

This sounds like a real bad idea.

If you don't want them to save the workbook, then make it read only. If you
want to prevent saving to a different name, then in the beforeclose event,
set Cancel = true and close the workbook.

Any macro based protection is easily defeated by disabling macros, however.

--
Regards,
Tom Ogilvy


"KandK" wrote in message
...
Tristan was kind enough to enlighten me into using Visual Basic Editor to
have a message box asking Are you sure you want to close? when someone

tries
to close a workbook. However it would be great if I could password protect
the closing of a workbook. This is the first time I have used Visual Basic
Editor so with my very limited experience and Microsoft Excel Help I could
not work out a way. So if anyone has any suggestions or could even tell me

it
is not possible it would be greatly appreciated. Many thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
KandK
 
Posts: n/a
Default PASSWORD PROTECT BEFORECLOSE

What I want to do is give the utmost ptotection to stopping someone closing a
workbook by accident. The workbook in question is going to be viewed on a
different monitor maybe in a position not viewable to the computer operator
so they may not be aware they have closed it. The computer in question is in
an office where it is used by many different people with varying degrees of
computer knowledge. although they would not do it on purpose it is possible
someone may shut it by mistake. Thanks for your advice anyway.

"Tom Ogilvy" wrote:

This sounds like a real bad idea.

If you don't want them to save the workbook, then make it read only. If you
want to prevent saving to a different name, then in the beforeclose event,
set Cancel = true and close the workbook.

Any macro based protection is easily defeated by disabling macros, however.

--
Regards,
Tom Ogilvy


"KandK" wrote in message
...
Tristan was kind enough to enlighten me into using Visual Basic Editor to
have a message box asking Are you sure you want to close? when someone

tries
to close a workbook. However it would be great if I could password protect
the closing of a workbook. This is the first time I have used Visual Basic
Editor so with my very limited experience and Microsoft Excel Help I could
not work out a way. So if anyone has any suggestions or could even tell me

it
is not possible it would be greatly appreciated. Many thanks.




  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default PASSWORD PROTECT BEFORECLOSE

I successfully completed a project like this last year- folks were
recycling forms- and not filling them out properly- which was creating
chaos in the organization. The sheets were forms were protected with some
cells unprotected that needed to be filled out. As users would 'recycle
them"- (open up an old form to 're-use' previously filled out info- they
were not too careful about completing it properly- so wrong information and
wrong instructions were conveyed, which resulted in a lot of wasted time by
the people who received the forms- all for the sake of a few people who
thought they'd save 2-3 minutes by re-using a previously filled-out-form.
The mistakes were easily 200-1 in cost/time. 2-3 minutes saved at the
clerical level led to extra expenditures that were hundreds of times more
costly and thousands in terms of delays.

Basically I had to write the routine to unlock some of the cells in the form
when opened, time stamp it when saved, but lock down as when saved. Ahh-
but this does not take care of the macro-defeater.

The best part was defeating the approach of disabling macros-
here's how I nailed that one:
Hide and password protect all the worksheets with one sheet left visible
that says that macros have to be enabled to view and use the sheet. As this
macro is executed upon opening, it hides this sheet and shows all the active
forms. The form cannot be loaded unless macros are enabled.

(Note- the average user that was 'recycling forms' did not have enough
savvy to use a password buster to break into the spreadsheet- otherwise I
would have used an Access database fronted into Visual Basic to create the
form instead of Excel.)

It was a lot of fun and a PITA (pain in the A##) all at the same time

let me know if you are interested and I can share the details.

Paul

..
"KandK" wrote in message
...
Tristan was kind enough to enlighten me into using Visual Basic Editor to
have a message box asking Are you sure you want to close? when someone
tries
to close a workbook. However it would be great if I could password protect
the closing of a workbook. This is the first time I have used Visual Basic
Editor so with my very limited experience and Microsoft Excel Help I could
not work out a way. So if anyone has any suggestions or could even tell me
it
is not possible it would be greatly appreciated. Many thanks.



  #5   Report Post  
Posted to microsoft.public.excel.misc
KandK
 
Posts: n/a
Default PASSWORD PROTECT BEFORECLOSE

Paul

Thanks for your reply that was really useful. The project I am working on is
still very much "In Progress". If you do not mind can I put your offer on
hold and if I encounter similar problems get in contact for the details.Once
again many thanks for responding I really do appreciate the time that people
spend giving help to people like myself.

Keith

" wrote:

I successfully completed a project like this last year- folks were
recycling forms- and not filling them out properly- which was creating
chaos in the organization. The sheets were forms were protected with some
cells unprotected that needed to be filled out. As users would 'recycle
them"- (open up an old form to 're-use' previously filled out info- they
were not too careful about completing it properly- so wrong information and
wrong instructions were conveyed, which resulted in a lot of wasted time by
the people who received the forms- all for the sake of a few people who
thought they'd save 2-3 minutes by re-using a previously filled-out-form.
The mistakes were easily 200-1 in cost/time. 2-3 minutes saved at the
clerical level led to extra expenditures that were hundreds of times more
costly and thousands in terms of delays.

Basically I had to write the routine to unlock some of the cells in the form
when opened, time stamp it when saved, but lock down as when saved. Ahh-
but this does not take care of the macro-defeater.

The best part was defeating the approach of disabling macros-
here's how I nailed that one:
Hide and password protect all the worksheets with one sheet left visible
that says that macros have to be enabled to view and use the sheet. As this
macro is executed upon opening, it hides this sheet and shows all the active
forms. The form cannot be loaded unless macros are enabled.

(Note- the average user that was 'recycling forms' did not have enough
savvy to use a password buster to break into the spreadsheet- otherwise I
would have used an Access database fronted into Visual Basic to create the
form instead of Excel.)

It was a lot of fun and a PITA (pain in the A##) all at the same time

let me know if you are interested and I can share the details.

Paul

..
"KandK" wrote in message
...
Tristan was kind enough to enlighten me into using Visual Basic Editor to
have a message box asking Are you sure you want to close? when someone
tries
to close a workbook. However it would be great if I could password protect
the closing of a workbook. This is the first time I have used Visual Basic
Editor so with my very limited experience and Microsoft Excel Help I could
not work out a way. So if anyone has any suggestions or could even tell me
it
is not possible it would be greatly appreciated. Many thanks.






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
How can I password protect a hidden column in Excel? Ira.Stoller Excel Worksheet Functions 9 April 24th 23 07:42 PM
Using VB to password protect, but sheet remains visible JennyJeneralGraves Excel Discussion (Misc queries) 0 March 30th 06 02:12 AM
Password Protect Dedrie Excel Worksheet Functions 0 August 19th 05 07:03 PM
Auto Protect workbook with password upon opening Brian Excel Worksheet Functions 0 February 23rd 05 05:45 PM
Password protect cells PivotTable & allow the Pivot Table to refre KJThams Excel Worksheet Functions 2 November 30th 04 04:13 AM


All times are GMT +1. The time now is 12:48 PM.

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

About Us

"It's about Microsoft Excel"