Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
Hi,
Try out this code-
With olAppt
Set oPat = .GetRecurrencePattern
.oPat.RecurrenceType = olRecursYearly
' Convert the date from the cell to a Date data type explicitly
Dim apptDate As Date
apptDate = DateValue(Cells(i, 3)) + TimeValue("9:00:00")
.Start = apptDate
' Calculate the end time
.End = apptDate + TimeValue("0:01:00")
.Subject = Cells(i, 1) & " " & Cells(i, 2) & " is on " & Format(apptDate, "Long Date") & " since " & Cells(i, 4)
.Body = .Subject
.BusyStatus = olFree
.ReminderMinutesBeforeStart = 10080
.ReminderSet = True
'.Categories = Cells(i, 4)
.Save
End With
I've added explicit conversion of the date from the cell to a Date data type using DateValue(). Also, I've used Format() to ensure that the date is presented to Outlook in a recognizable format.
Also, ensure that your Outlook version and Excel version are compatible with the VBA libraries and references you're using.
Best Regards.