Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am looking for help with the following task:
1. User clicks button on worksheet 2. Userform opens asking for username and password 3. The username and password information is verified against active directory 4. If username and password match AD, the user's initials are entered into a particular cell 5. If username and password do not match AD, a msgbox advises the user of the incorrect information. I already have the userform created and know how to do the msgbox stuff, I am just looking for the code to validate the user entered information to that in AD. Any suggesetions would be great. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does this work for you?
http://www.vbforums.com/showthread.php?t=352349 --JP On Nov 24, 12:47*pm, josh wrote: I am looking for help with the following task: 1. User clicks button on worksheet 2. Userform opens asking for username and password 3. The username and password information is verified against active directory 4. If username and password match AD, the user's initials are entered into a particular cell 5. If username and password do not match AD, a msgbox advises the user of the incorrect information. I already have the userform created and know how to do the msgbox stuff, I am just looking for the code to validate the user entered information to that in AD. Any suggesetions would be great. Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I copy and paste that code, I get a "Syntax error" at the first line of
the code. Do I need to modify his code to work in VBA? Sorry for the ignorance. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, you can't set initial values like that in VBA. The default for
Boolean is False anyway. So change Dim Success As Boolean = False to Dim Success As Boolean --JP On Nov 25, 7:17*am, josh wrote: If I copy and paste that code, I get a "Syntax error" at the first line of the code. *Do I need to modify his code to work in VBA? *Sorry for the ignorance. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. After doing that I also get a syntax error on the next line of code:
Dim Entry As New System.DirectoryServices.DirectoryEntry("LDAP://" & Domain, Username, Password) Any ideas? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looks like I'm batting .1000. Turns out that code is for .NET, it
won't work in VBA at all. Sample code: http://www.freevbcode.com/ShowCode.Asp?ID=710 http://my.advisor.com/doc/08691 http://bytes.com/topic/access/answer...tory-usage-vba You'll also want to check out the ADSI reference on MSDN (it's a COM interface for use by non-.NET languages like VBA): http://msdn.microsoft.com/en-us/libr...70(VS.85).aspx --JP On Nov 25, 10:22*am, josh wrote: Thanks. *After doing that I also get a syntax error on the next line of code: Dim Entry As New System.DirectoryServices.DirectoryEntry("LDAP://" & Domain, Username, Password) Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I get a adcenter username and password | Excel Discussion (Misc queries) | |||
Listing Active Directory groups that have directory access rights | Excel Programming | |||
Save active sheet as "filename" on a remote server with username and password | Excel Programming | |||
Password/UserName | Excel Programming | |||
Active Directory and UserName | Excel Programming |