EliseFreedman
Programmer
Hi There
Im experimenting with excel. We have a spreadsheet containing training data. We are wanting to send a meeting invite to all users whose training has expired to get them to complete the training. The code works fine in my diary and puts in the meeting request at the appropriate date and time but I have tested it on a couple of my colleagues and they don't receive anything. When I stepped through the data using the debug tool, it definitely picks up their email address yet they never receive an invite.
Anyone got any ideas.
Im experimenting with excel. We have a spreadsheet containing training data. We are wanting to send a meeting invite to all users whose training has expired to get them to complete the training. The code works fine in my diary and puts in the meeting request at the appropriate date and time but I have tested it on a couple of my colleagues and they don't receive anything. When I stepped through the data using the debug tool, it definitely picks up their email address yet they never receive an invite.
Anyone got any ideas.
Code:
Sub AddAppointments()
' Create the Outlook session
Dim N As Long, i As Long
Set myOutlook = CreateObject("Outlook.Application")
' Start at row 2
N = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To N
If Cells(i, 18).Value = "Yes" Then
Set MyApt = myOutlook.CreateItem(1)
' Set the appointment properties
MyApt.Subject = "DSE Training Required"
'myApt.Location = Cells(r, 2).Value
MyApt.RequiredAttendees = Cells(i, 5).Value
MsgBox Cells(i, 5).Value
MyApt.Start = Cells(i, 6).Value
MyApt.Duration = 60
' If Busy Status is not specified, default to 2 (Busy)
MyApt.ReminderSet = True
MyApt.ReminderMinutesBeforeStart = 60
MyApt.Body = "Please Complete your bronze Passport DSE Training"
MyApt.Save
End If
Next i
' Loop
End Sub