Link to home
Start Free TrialLog in
Avatar of keilah
keilahFlag for Netherlands

asked on

Password Protect Workbook and worksheet - Allow Five Attemps

Hi Developers need a vba code to password protect a workbook and work sheet in the work book. 5 attemps at the code before locking out.

Same password for workbook and worksheets.......

thanks...........
Avatar of MalicUK
MalicUK

Hi keilah,

It sounds like you are trying to do some advanced protection, and the fact is that no protection is going to stand up more than 2 minutes to anyone who really wants to get in the file - excel protection just isn't that robust and there are too many tools out there to crack excel passwords.

The normal code for excel protection is:

Sheet:
Sheets("mySheet").Protect "myPassword"

Workbook:
Workbook("myWorkbook").SaveAs Workbook("myWorkbook").FullName, , "myPassword"

These don't however include the functionality to lock someone out after 5 tries, and I don't believe that there is going to be a simple way to implement this in Excel.

Cheers,
MalicUK.
ASKER CERTIFIED SOLUTION
Avatar of [ fanpages ]
[ fanpages ]

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PS.
SerialShield SDK may also prove useful:
[ http://www.ionworx.com/serialshield.html ]


Please let me/us know what option you go for.

Thanks.

BFN,

fp.