I have the below VBA formula created. It takes entries from Excel and enters them as a meeting request in Micro Soft Outlook. It works quite well, however, everytime I run it, it enters all of the meeting requests again. I am look for a way to have it not double post entries every time I run it.
Private Sub AddToOLCalendar()
Dim objOL As Object
Dim objItem As Object
Dim lngRow As Long
Set objOL = CreateObject("Outlook.Application")
lngRow = 1
Do While ActiveSheet.Cells(lngRow, 1) <> ""
If ActiveSheet.Cells(lngRow, 2).Text <> "" Then
Set objItem = objOL.CreateItem(1) ' constant olAppointmentItem = 2
With objItem
.Body = Cells(lngRow, "C").Value
.Duration = 15
.Start = Cells(lngRow, "A").Value & " 9:00:00 AM"
.Subject = Cells(lngRow, "B").Value
.Save
End With
End If
lngRow = lngRow + 1
Loop
Set objItem = Nothing
Set objOL = Nothing
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
Private Sub AddToOLCalendar()
Dim objOL As Object
Dim objItem As Object
Dim lngRow As Long
Set objOL = CreateObject("Outlook.Application")
lngRow = 1
Do While ActiveSheet.Cells(lngRow, 1) <> ""
If ActiveSheet.Cells(lngRow, 2).Text <> "" Then
Set objItem = objOL.CreateItem(1) ' constant olAppointmentItem = 2
With objItem
.Body = Cells(lngRow, "C").Value
.Duration = 15
.Start = Cells(lngRow, "A").Value & " 9:00:00 AM"
.Subject = Cells(lngRow, "B").Value
.Save
End With
End If
lngRow = lngRow + 1
Loop
Set objItem = Nothing
Set objOL = Nothing
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub