Adding Appointments from Excel Spreadsheet to Outlook Calendar

Bwiles96

New Member
Joined
Apr 5, 2022
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I am needing assistance in implementing a code into my existing code to not add already scheduled appointments to the calendar. Basically I will be running this everyday, and everyday a new entry is added to the excel document. However, the code I have now will add appointments that were already added the previous days. I am looking for a way to not duplicate appointments.

ALSO! I am needing to find a way to make this code add the appointments to a SHARED calendar. Right now it only adds to my personal one. Any and all help is so very much appreciated.

Code:

Sub Appointments()

Dim OL As Outlook.Application, Appoint As Outlook.AppointmentItem, ES As Worksheet, _
r As Long, i As Long, WB As ThisWorkbook

Set WB = ThisWorkbook
Set ES = WB.Sheets("Sheet1")
r = ES.Cells(Rows.Count, 1).End(xlUp).Row
Set OL = New Outlook.Application

For i = 2 To r
If ES.Cells(i, 15) = "Bulk" Then
Set Appoint = OL.CreateItem(olAppointmentItem)
With Appoint
.Subject = ES.Cells(i, 13).Value
.Start = ES.Cells(i, 4).Value
.Duration = 60
.AllDayEvent = False
.Categories = ES.Cells(i, 16).Value & " Category"
.Body = ES.Cells(i, 12).Value
.Save
End With
End If
Next i
Set OL = Nothing

End Sub


I have not had a starting place on my request, so all help is appreciated.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,215,676
Messages
6,126,171
Members
449,296
Latest member
tinneytwin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top