Hi there, new to the forum here.
I am wanting to have data entered into Excel that would create a meeting request in Outlook. I have Office 2010 and am on Windows XP.
Column A - Contains the date that I want to have as the meeting date
Column B - Contains the meeting subject Line
Column C - Contains the contents of the meeting
I would like it to look at all items and post new meeting requests only, no duplicates.
Here is what i have found so far, it only works to create 1 meeting request, can't get it to do more:
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 = Range("c1")
.Duration = 15
.Start = Range("A1") & " 9:00:00 AM"
.Subject = Range("B1")
.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
I am wanting to have data entered into Excel that would create a meeting request in Outlook. I have Office 2010 and am on Windows XP.
Column A - Contains the date that I want to have as the meeting date
Column B - Contains the meeting subject Line
Column C - Contains the contents of the meeting
I would like it to look at all items and post new meeting requests only, no duplicates.
Here is what i have found so far, it only works to create 1 meeting request, can't get it to do more:
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 = Range("c1")
.Duration = 15
.Start = Range("A1") & " 9:00:00 AM"
.Subject = Range("B1")
.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