Hi, I have a problem that stops us from sending appointments to our technichians. I have a macro written in Excel 2016 that create appointments in Outlook (and a lot of other things) which works fine on my computer and others. Now one person has a new computer (also Excel 2016) where everything works except the red rows below.
With oFolder
Set olApt = oApp.CreateItem(olAppointmentItem)
olApt.MeetingStatus = olMeeting
With olApt
.Start = Cells(6, 3).Value + Cells(8, 3)
.End = Cells(6, 3) + DateAdd("n", Cells(10, 3).Value, Cells(8, 3))
.Subject = SR + " " + Cells(12, 6) + " " + Cells(8, 6)
.Location = Cells(10, 6)
.Body = Cells(6, 6) + vbNewLine + vbNewLine + Cells(16, 3)
.BusyStatus = olFree
.ReminderMinutesBeforeStart = Cells(12, 3)
.ReminderSet = True
' get the recipients
Dim RequiredAttendee, OptionalAttendee, ResourceAttendee As Outlook.Recipient
Set RequiredAttendee = .Recipients.Add(Cells(14, 3).Value)
RequiredAttendee.Type = olRequired
'Display 'Ta bort denna om bokningen ska skickas automatiskt
.Send
.Save
.Move oFolder
End With
We get an error message:
"Run-time error '-2147417851 (80010105)':
Method 'Location' of object '_AppointmentItem' failed
I have googled and I found a lot of matches but havn't been able to solve it. Does anybody know what I can do or have any suggestions?
Thank you in advance,
Johan
Bookmarks