View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.misc
Dan Wood Dan Wood is offline
external usenet poster
 
Posts: 49
Default Creating Appointment

I have amended the script slightly to fit in with the fields that i will be
using but am getting a run time 13 error.

My amended script is:-

Sub OLApp()

Dim objOL As Object, objApp As Object, lngRow As Long

Set objOL = CreateObject("Outlook.Application")

For lngRow = 9 To Cells(Rows.Count, "A").End(xlUp).Row
If Range("E" & lngRow) = "" Then
Set objApp = objOL.CreateItem(1)
With objApp
..Subject = "Change Password for system" & Range("A" & lngRow)
..Start = Range("B" & lngRow)
..ReminderPlaySound = True
..Save
End With
Range("E" & lngRow) = "Done"
End If
Next

Set objOL = Nothing
End Sub


So the system name is in colum A starting from cell 9, then the date is
starting from D9, then the field to say the appointment has been added will
be E9.