Bonjour,
Dans mon fichier excel, je voudrais que pour chaque nouvelle entrée dans la colonne F2 jusqu'à F20, ça génère un rendez vous sur outlook. J'utilise un code qui fonctionne mais dans outlook la date est toujours la même : 31/12/1899.
Quelqu'un peut m'aider ?
Merci :
Mon code :
Sub NouveauRDV_Calendrier()
Dim myOlApp As New Outlook.Application
Dim MyItem As Outlook.AppointmentItem
Dim Cell As Range
For Each Cell In Range("E2:E" & Range("E20").End(xlUp).Row)
If IsEmpty(Range("F" & Cell.Row)) Then
Set MyItem = myOlApp.CreateItem(olAppointmentItem)
With MyItem
.MeetingStatus = olNonMeeting
.Subject = Cell
.Start = Cell.Offset(0, 1)
.Duration = Cell.Offset(0, 2)
.Location = Cell.Offset(0, 3)
.Save
End With
Range("F" & Cell.Row) = "X" 'Au lieu de X on peut mettre n'importe quoi, la date de création du rendez-vous...
End If
Set MyItem = Nothing
Next Cell
End Sub