PDA

View Full Version : Solved: Two Passwords (User & Master)



geekjock
01-29-2008, 08:32 PM
Found this board via google and was hoping if anyone could assist me with this dilemma. I know Excel is not secure but, my clients aren't Excel Savvy, so security breaks are not of concerns.

Private Sub Workbook_Activate()
Dim storedPath As String

On Error Resume Next
storedPath = ThisWorkbook.CustomDocumentProperties("PathCertString").Value
On Error GoTo 0

If storedPath = Application.Path Then
Rem is on right computer
MsgBox "Welcome"
Else
Rem wrong computer, password required
If "password" = LCase(Application.InputBox("Wrong computer. I need password.", Type:=2)) Then
MsgBox "Good password"
Rem remember new path to OK comuter
With ThisWorkbook
On Error Resume Next
.CustomDocumentProperties("PathCertString").Delete
On Error GoTo 0
.CustomDocumentProperties.Add Name:="PathCertString", _
Value:=Application.Path, LinkToContent:=False, Type:=msoPropertyTypeString
End With
Else
MsgBox "Wrong password. Goodbye"
ThisWorkbook.Saved = True
ThisWorkbook.Close
End If
End If

End Sub


I was wondering if it were possible after the client enters the password, captures the users computer's information, the password automatically changes to a password only known by the creator. (Basically have two passwords; a client password & administrator password)

Ex.
If I inform the client what his password would be, he enter's the password I provide to him. After the client enters the password, and opens the file, the client's password automatically changes to the administrator's password. The client will not know my password, therefore, if the file is distributed to another computer, than upon opening the file on the new computer, it will prompt for the administrator's password. (of course, the client or the new user will not know my password, because they would not know the password had changed to my password).

Bob Phillips
01-30-2008, 01:37 AM
Why not just check the user login and have a pssword associated with each user. I don't see the point of the two.

gwkenny
01-30-2008, 01:55 AM
Alternatively you can stick with one password.

But the password changes depending on the date and/or time.

For example, if it's August 19th. You can use AUG and 19 in your password: vage93u2a.

3rd position, is the third letter of the month, 5th position is the one's digit of the day, 7th position is the second letterof the month, and the 9th position is the first letter of the month. Everything else is random.

g-
gwkenny@Fin-ITSolutions.com
___________________________________
Looking for jobs big or small, drop me a line! Thanks!

mikerickson
01-30-2008, 06:48 AM
cross post
http://www.mrexcel.com/forum/showthread.php?t=300159&page=3