Excel VBA: Outlook does not recognize one or more names

dougdrex

Board Regular
Joined
Sep 27, 2013
Messages
79
I'm using Excel 2010.

I have a string variable named strMaker that is assigned to another variable (to combine values with another variable) before being assigned to an outgoing email message using Outlook. The value contained in strMaker is an employee ID that gets assigned to the "Cc" field and sent via internal email.

The problem is that sometimes there is an employee ID of a person who is no longer with the company and the macro produces the "Outlook does not recognize one or more names" error. I would like to insert some code that would check to see if the employee ID (strMaker) is recognized by Outlook before assigning it to the "Cc" field of the email, and possibly even prompting the user to provide an alternative employee ID.

Below is the current code. Please let me know if you have any ideas.

Thanks!
Doug

Code:
Dim strMaker As String

strMaker = GetVisibleMaker(Range("H2", Cells(Rows.Count, "H").End(xlUp)))

strCC = strMaker & "; " & strDL

    With OlMailItem
        .CC = strCC
        .Send

Please let me know if more information is required.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top