close

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.

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

quot;Tom Ogilvyquot; wrote:

gt; This sounds like a real bad idea.
gt;
gt; If you don't want them to save the workbook, then make it read only. If you
gt; want to prevent saving to a different name, then in the beforeclose event,
gt; set Cancel = true and close the workbook.
gt;
gt; Any macro based protection is easily defeated by disabling macros, however.
gt;
gt; --
gt; Regards,
gt; Tom Ogilvy
gt;
gt;
gt; quot;KandKquot; gt; wrote in message
gt; ...
gt; gt; Tristan was kind enough to enlighten me into using Visual Basic Editor to
gt; gt; have a message box asking Are you sure you want to close? when someone
gt; tries
gt; gt; to close a workbook. However it would be great if I could password protect
gt; gt; the closing of a workbook. This is the first time I have used Visual Basic
gt; gt; Editor so with my very limited experience and Microsoft Excel Help I could
gt; gt; not work out a way. So if anyone has any suggestions or could even tell me
gt; it
gt; gt; is not possible it would be greatly appreciated. Many thanks.
gt;
gt;
gt;

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
themquot;- (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

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

Thanks for your reply that was really useful. The project I am working on is
still very much quot;In Progressquot;. 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

quot; wrote:

gt; I successfully completed a project like this last year- folks were
gt; recycling forms- and not filling them out properly- which was creating
gt; chaos in the organization. The sheets were forms were protected with some
gt; cells unprotected that needed to be filled out. As users would 'recycle
gt; themquot;- (open up an old form to 're-use' previously filled out info- they
gt; were not too careful about completing it properly- so wrong information and
gt; wrong instructions were conveyed, which resulted in a lot of wasted time by
gt; the people who received the forms- all for the sake of a few people who
gt; thought they'd save 2-3 minutes by re-using a previously filled-out-form.
gt; The mistakes were easily 200-1 in cost/time. 2-3 minutes saved at the
gt; clerical level led to extra expenditures that were hundreds of times more
gt; costly and thousands in terms of delays.
gt;
gt; Basically I had to write the routine to unlock some of the cells in the form
gt; when opened, time stamp it when saved, but lock down as when saved. Ahh-
gt; but this does not take care of the macro-defeater.
gt;
gt; The best part was defeating the approach of disabling macros-
gt; here's how I nailed that one:
gt; Hide and password protect all the worksheets with one sheet left visible
gt; that says that macros have to be enabled to view and use the sheet. As this
gt; macro is executed upon opening, it hides this sheet and shows all the active
gt; forms. The form cannot be loaded unless macros are enabled.
gt;
gt; (Note- the average user that was 'recycling forms' did not have enough
gt; savvy to use a password buster to break into the spreadsheet- otherwise I
gt; would have used an Access database fronted into Visual Basic to create the
gt; form instead of Excel.)
gt;
gt; It was a lot of fun and a PITA (pain in the A##) all at the same time
gt;
gt; let me know if you are interested and I can share the details.
gt;
gt; Paul
gt;
gt; ..
gt; quot;KandKquot; gt; wrote in message
gt; ...
gt; gt; Tristan was kind enough to enlighten me into using Visual Basic Editor to
gt; gt; have a message box asking Are you sure you want to close? when someone
gt; gt; tries
gt; gt; to close a workbook. However it would be great if I could password protect
gt; gt; the closing of a workbook. This is the first time I have used Visual Basic
gt; gt; Editor so with my very limited experience and Microsoft Excel Help I could
gt; gt; not work out a way. So if anyone has any suggestions or could even tell me
gt; gt; it
gt; gt; is not possible it would be greatly appreciated. Many thanks.
gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()