Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Require Username/Password on Excel Workbook Open 2

Status
Not open for further replies.

bdmangum

Technical User
Dec 6, 2006
171
US
I have a workbook to which I would like to add user and password control. I want the user to login with their network id and password. Currently I have the code below which grabs the user's profile from the active directory. I can't seem to find a method for matching the password though. Anyone have ideas?

Code:
Public Function ADsFullName() As String

    Dim objIADsUser As ActiveDs.IADsUser
    Dim strUserID As String, strDomainName As String, strFullName As String
    
    strUserID = Environ$("USERNAME")
    strDomainName = "WORKPLACE"
    
    Set objIADsUser = GetObject("WinNT://" & strDomainName & "/" & strUserID & ",user")
    strFullName = objIADsUser.FullName
    Set objIADsUser = Nothing
    
    MsgBox strFullName

End Function

I'm thinking I could take the userid field and run it through the above macro to find the appropriate profile where I could match the password fields. I just need to figure out how to find and match the password.

TIA,
BD

 





Hi,

Why would you need their network password, if they are logged into the network already?

Who else would be accessing your workbook other than those already logged into the network?

Do you want to restrict access to the workbook to a list of UID's?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 




Seems to me that its like having to use the front door key to get into the bathroom: unnecessary security and darn annoying!!!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Valid points Skip, in fact the same ones I brought up myself when tasked with the additional security. However the people who requested the project would like this additional security due to the sensitive nature of the information to be stored in the spreadsheet. Yeah, it's like using the front door for the bathroom.

Thus regardless of the repetitive nature of the security, I need to add it in. I guess they figure someone could log into their computer and forget to log out thus giving someone else access to the file or something. Yeah I know it doesn't make much sense, but when it's a project requirement you gotta do it anyways...
 




So you have to cover for someone elses breach of security practices?

Don't know how you'd use the network PW. I'd beat the UID against the known list of authorized users. If necessary, provide them with a workbook password of your choice.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
bdmangum

They are aware of an application to do "Office Password Recovery"???

How strong are their users passwords??? This 111111 is valid for my domain!
 



Strong man!!! ==> *

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks strongm! Exactly what I was looking for...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top