If Not Intersect(Target, Range("C187")) Is Nothing Then
choix = MsgBox("Confirmez-vous la date du " & Range("C187") & " pour cette échéance? Un évènement sera créé à cette date dans votre calendrier ", 36, "Confirmation")
'Si l'utilisateur a cliqué sur le bouton Oui
If choix = vbYes Then
Dim objOL
Dim objAppt
Const olAppointmentItem = 1
Const olMeeting = 1
Set objOL = CreateObject("Outlook.Application")
Set objAppt = objOL.CreateItem(olMeeting)
With objAppt
.Subject = "Date limite engagement des dépenses financement Etat " & Range("E177") & " Projet " & Range("C5")
.Body = "Ceci est un évènement généré lors de la saisie"
.Start = Range("C187")
.AllDayEvent = True
.BusyStatus = olFree
.Categories = "Echéance Automatique "
.ReminderSet = True
.ReminderMinutesBeforeStart = 21600
.Importance = olImportanceHigh
.Location = "CCVT"
.MeetingStatus = olMeeting
'participant optionnel
.OptionalAttendees = ADDRESSEDUGEST
'participant obligatoire
.RequiredAttendees = Range("E9")
.send
End With
Set objAppt = Nothing
Set objOL = Nothing
End If
If choix = vbNo Then
Range("C187") = ""
Range("C187").Select
End If
End If
End If