I think something like:
In a Standard Module:
Option Explicit
Public Sub CreateOutlookAppt()
Const olFolderCalendar = 9&
Const olAppointmentItem = 1&
' late-bound | early-bound
Dim OL As Object ' Outlook.Application
Dim olAppt As Object ' Outlook.AppointmentItem
Dim olNameSpc As Object ' Outlook.Namespace
Dim olCal As Object ' Outlook.Folder
On Error Resume Next
Set OL = GetObject(, "Outlook.Application")
On Error GoTo 0
If OL Is Nothing Then
MsgBox "You need to be logged into Outlook", vbInformation, "ERROR: Outlook not running"
Exit Sub
End If
Set olNameSpc = OL.GetNamespace("MAPI")
Set olCal = olNameSpc.GetDefaultFolder(olFolderCalendar).Folders.Item("UK Customer Services Calendar")
Set olAppt = olCal.Items.Add(olAppointmentItem)
With olAppt
.Categories = "Purple Category" '< whatever you have them saved as
.AllDayEvent = True
.Start = DateSerial(2017, 5, 25) + TimeSerial(0, 0, 0) '<---your cell reference
.Subject = "My Test"
'.Body = "Whatever text you want, if any"
.Save
End With
End Sub
Notes:
- I have never figured out a good way to see if I am logged into Outlook. Sure, I can test if it's running, but not if I am signed-in and can send emails...
- For adding an appointment, it appears I do not need to worry about this (as long as I am not sending notices...)
- I would probably look for articles/threads/answers by Sue Mosher.
Hope that helps,
Mark