Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating Outlook meeting requests based on dates in an excel Spreadsheet

Status
Not open for further replies.

EliseFreedman

Programmer
Dec 6, 2002
470
GB
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.

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

 
 http://files.engineering.com/getfile.aspx?folder=5ed74a75-1a33-43c3-873d-b06e821c22b4&file=SHE_Training_Report_-_Comms_and_HR_May_2016.xls
Elsie,

Are you missing a Send?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top