PDA

View Full Version : Sleeper: Deactivate workbook after 3 login attempts



austenr
09-14-2005, 01:14 PM
This whole thing (http://www.vbaexpress.com/forum/showthread.php?t=5169) has me wondering. I think I saw this on this board but do not remember if I did or not. Is there a way to hide everything until the user enters a correct password? And after so many tries you get locked out and the workbook will not open even if you get the correct PW? I have a real need for this if it can be done and I believe it can be? Any ideas.

Ken Puls
09-14-2005, 01:45 PM
One method that comes to mind...

On Workbook_Close set all sheets except a warning page to xlveryhidden
Tell the user that they need to have macros enabled on that sheet
Prompt for password at entry
Log each attempt to cell
If successful, clear count and unprotect sheets, otherwise add 1 to the count
If count gets to 3, set a random Workbook Open password and close the file

Course... this could render it unusable to you as well. :)

PS: You may want to split this conversation to a new thread as I'll bet it continues on a bit. ;)

austenr
09-14-2005, 01:52 PM
that it might. Trying to figure out the most secure way to send a spreadsheet back and forth. I realize that these are fairly easy to hack the passwords on anyway no matter how hard you try.

Ken Puls
09-14-2005, 01:57 PM
True, although the Workbook password is the most difficult, I believe. Any protection accomplished in the Excel interface is pretty vulnerable to a skilled hacker, but that's not really who I try and stop. 99.9% of people will be stuck if you put in a level of protection like that above.

mdmackillop
09-14-2005, 03:51 PM
In my case. I set my password protection as blank. It's purely there to prevent accidental changes to formulae etc. so for this level of protection, it's all I need.
If we're going to write supposedly "secure" code, do we need a suggested scale? e.g. 0 - 10, where 10 (or even 9) would never be achieved. Just a thought.

Ken Puls
09-14-2005, 11:41 PM
I split the thread, guys. ;)

johnske
09-15-2005, 01:00 AM
..... Is there a way to hide everything until the user enters a correct password? And after so many tries you get locked out and the workbook will not open even if you get the correct PW? I have a real need for this if it can be done and I believe it can be? Any ideas.Hi Austen,

Perhaps this's something similar to what you're after... http://www.vbaexpress.com/kb/getarticle.php?kb_id=516

HTH,
John :)

austenr
09-15-2005, 08:02 AM
Hey John. What I was really looking for was the ability to make Excel look like a clean worksheet with no gridlines, and only reveal what is on the sheet if a successful PW is entered. After 3 tries the workbook locks you from entering any more attempts.