Protection problem macro

C

CLR

Hi All...........

Would it be possible to have a Macro that would, upon opening a workbook,
just sit there and wait, whether the user does some cell entries or not,
but when they particularly do the sequence Tools > Protection > and either
"Unprotect sheet" or "Unprotect workbook" the macro would come alive and
cause the whole workbook to close without saving......."unless" the user had
entered the code "1.5" in a particular cell (say F3) before they did that
sequence? Or, if this isn't feasible, perhaps another method that would
prevent a "password busting" programs from working.

Any help would be much appreciated.

Vaya con Dios,
Chuck, CABGx3
 
J

Jim Rech

A password breaking macro does not use the menus, so even if you could get
what you described, it wouldn't interfere with a macro.

Another problem with the whole concept of using a macro to stop a user is
that there is no way to make a macro run. A user can always disable macros.

--
Jim Rech
Excel MVP
| Hi All...........
|
| Would it be possible to have a Macro that would, upon opening a workbook,
| just sit there and wait, whether the user does some cell entries or not,
| but when they particularly do the sequence Tools > Protection > and
either
| "Unprotect sheet" or "Unprotect workbook" the macro would come alive and
| cause the whole workbook to close without saving......."unless" the user
had
| entered the code "1.5" in a particular cell (say F3) before they did that
| sequence? Or, if this isn't feasible, perhaps another method that would
| prevent a "password busting" programs from working.
|
| Any help would be much appreciated.
|
| Vaya con Dios,
| Chuck, CABGx3
|
|
|
|
 
J

JE McGimpsey

You can certainly use a Workbook_Open macro to reassign the OnAction
item for the Unprotect Sheet... and Unprotect workbook... menu items.
Then use a Worksheet_Change event macro to reset the controls if the
code is entered in F3.

However, that still won't prevent a password busting program from
working.
 
C

CLR

Ok Jim and JE , thanks for the input.........I guess my thinking has turned
around a bit because of it. I don't really care now if the "Worksheet
unprotect" action has occured by either manual manupulations of the buttons
or by a macro.........what I really care about is knowing that it HAS
occured.......and that flag used to trigger a sequence that eventually shuts
down the workbook if the code is not in F3........let 'em break the
password, I just don't want them to be able to do anything more once they've
done that.

Is it possible to know when the "worksheet unprotect" action has taken
place?

Vaya con Dios,
Chuck CABGx3
 
J

Jim Rech

Is it possible to know when the "worksheet unprotect" action has taken
place?


I don't think so, sorry.

--
Jim Rech
Excel MVP
| Ok Jim and JE , thanks for the input.........I guess my thinking has
turned
| around a bit because of it. I don't really care now if the "Worksheet
| unprotect" action has occured by either manual manupulations of the
buttons
| or by a macro.........what I really care about is knowing that it HAS
| occured.......and that flag used to trigger a sequence that eventually
shuts
| down the workbook if the code is not in F3........let 'em break the
| password, I just don't want them to be able to do anything more once
they've
| done that.
|
| Is it possible to know when the "worksheet unprotect" action has taken
| place?
|
| Vaya con Dios,
| Chuck CABGx3
|
|
|
|
|
|
| | > Hi All...........
| >
| > Would it be possible to have a Macro that would, upon opening a
workbook,
| > just sit there and wait, whether the user does some cell entries or
not,
| > but when they particularly do the sequence Tools > Protection > and
| either
| > "Unprotect sheet" or "Unprotect workbook" the macro would come alive and
| > cause the whole workbook to close without saving......."unless" the user
| had
| > entered the code "1.5" in a particular cell (say F3) before they did
that
| > sequence? Or, if this isn't feasible, perhaps another method that
would
| > prevent a "password busting" programs from working.
| >
| > Any help would be much appreciated.
| >
| > Vaya con Dios,
| > Chuck, CABGx3
| >
| >
| >
| >
|
|
 
J

JE McGimpsey

Not that I know of... You could use an OnTime macro to check every so
often. However, that doesn't prevent someone from opening the file with
macros disabled...
 
C

CLR

Thanks again JE.........both your OnAction and OnTime suggestions are very
interesting.........I dont know how to use them but am for sure gonna look
them up realgood...........

I do have several cells that "must" be filled in in this workorder form for
it to be useful, so was thinking about just a change event macro on those
cells to check for the protection and code in the cell and then use it to
shut things down..........bummer that the user has the opportunity to
disable macros..........is there any way to shut the workbook down if they
choose not to enable macros?.....and/or, is there any way for a "formula" to
detect if the worksheet is protected or not?

Vaya con Dios,
Chuck, CABGx3
 
T

Tom Ogilvy

No.

If macros are disabled, they are disabled. Formulas return values to
cells - they don't close workbooks.

Sound like you need to put your sensitive items in an addin that accompanies
your workbook.
 
Top