Hey Guys,
Im having a slight issue with a type mismatch
Basically what the code is doing is referring to a contact distribution list(emails), and everytime it uses one it wants to go to the one under it, then use that one . It will repeat this process as many times as there are contacts using a separate counter(within the distribution sheet, it basically just counts how many emails are in the list and then feeds it into the code).
I was wondering if the syntax for the statement in red was incorrect. I can include more code if necessary however I wanted to keep it to the point.
Many thanks,
LMjdm
Im having a slight issue with a type mismatch
Code:
Do While placeHolder <> 0
placeHolder = placeHolder - 1
[COLOR=#ff0000]Set CAMX = Sheets("Distribution").Range("D" + contactCounter)[/COLOR] 'declared as a variant.. 'if there is a better type please let me know
contactCounter = countactCounter + 1
Application.ScreenUpdating = False
If camWelcomeMessage = 0 Then
message = "CAMs, the following is a reminder for the upcoming business rhythm:"
Set lync = Messenger.InstantMessage(CAMX)
lync.SendText (message)
End If
message = dayPlan.Offset(0, 2)
Set lync = Messenger.InstantMessage(CAMX)
lync.SendText (message)
If dayPlan.Offset(0, 3) = 0 Then
message = "As of: Today, " & asOf
ElseIf dayPlan.Offset(0, 3) = -1 Then
message = "As of: Yesterday, " & asOf
Else
message = "As of: " & asOf
End If
lync.SendText (message)
If dayPlan.Offset(0, 4) = 1 Then
message = "Due: Close of business, " & dueDay
ElseIf dayPlan.Offset(0, 4) = 2 Then
message = "Due: Tomorrow, " & dueDay
Else
message = "Due: " & dueDay
End If
lync.SendText (message)
On Error Resume Next
lync.Close
Application.ScreenUpdating = True
Loop
Basically what the code is doing is referring to a contact distribution list(emails), and everytime it uses one it wants to go to the one under it, then use that one . It will repeat this process as many times as there are contacts using a separate counter(within the distribution sheet, it basically just counts how many emails are in the list and then feeds it into the code).
I was wondering if the syntax for the statement in red was incorrect. I can include more code if necessary however I wanted to keep it to the point.
Many thanks,
LMjdm