From: LikeToCode on
Hi Dan,
This is the line of code causing your error.

Set objContact = objContainer.Create("Contact","cn=" & strContactName)

There are two reasons for your errors.
1) objContainer does not contain any connection to Active Directory
2) "cn=" & strContactName requires double quotes (") around the username.

Change the above line of code to this and it should work for you.

Set objContact = objOU.Create("Contact",_
"cn=" & Chr(34) & strContactName & Chr(34))

From: LikeToCode on
Sorry I did not catch this before but in your code you have "cn=" &
strContactName and strContactName = objuser.name which translates to
"CN=UserName". So this
"cn=" & strContactName MEANS THIS "cn=CN=UserName" soooooo Remove the "cn="
from your code.

Set objContact = objOU.Create("Contact", Chr(34) & strContactName & Chr(34))