Outlook does not recognize names when email triggered from Macro


New Member
Jan 29, 2010
Hi MrExcel members,

I am new to the VB Scripting and this is my first ever post on any forums:).

Ok here i go with my problem -

I have written one macro which sends automatic email notification when certain condition is not fulfilled. This macro basically tracks a particular activity to be performed by each project member (no of project members is around 35). Each one of us have been given a unique user id which is mapped to the email address of that person. E.g. mine is XYvs9, where XY are constant and do not change and V and S are starting letters for my initials and surname. So following this pattern is someone with the same intial and last name joins the project, he/she is assigned in the same way like a8vs10 and so on...

i have stored all these user id's within the excel and taking reference to these user ids i am performing some validation and sending the email. If you manually type this user id in To/Cc box of Outlook, these user ids are autopopulated with the corresponding email ids. Yesterday when i ran my code i faced a weird situation where macro threw me the error "Outlook does not recognize one or more names.". After lots of research and ending up with no solution from web, I myself figured out Outlook is not able to resolve the user id-email mapping for particular users. When i researched more, I figured out a pattern where it was failing.

Suppose there are 20 people with initials and last names as V and S, then there will be user ids ranging from XYVS1 to XYVS20. and when you type any of the values from XYVS1 to XYVS9, outlook is not able to resolve the email id for that person. When i just typed XYVS1 and pressed CTRL+K keys, i got "Check Names" box where it says there are more than one names found for XYVS1. Actually it is not able make differentiation between XYVS1 and XYVS11. This problem is not seen when you type XYVS11, in this case it is giving me the correct email id for that user name.
Because of this my VB Code is failing for each user where this situation is encountered. I can resolve this problem by creating one more column and giving corresponding email ids for related user name within the macro, but i dont like this solution.
Is there any way i can handle this using code???

Thank you in advance for any help.

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...