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
Please let me know if more information is required.
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.