bonsoir sousou je vient de voir ton message maintenant bon je vou sinforme que j'ai essayé avec ce code mais toujours meme probleme erreur d'exuction '287' erreur definie par l'apllication ou par l'object
voila le code que j'ai crée
Private Sub Worksheet_Change(ByVal Target As Range)
If Me.Cells(3, Target.Column).Value = "date d'intervention" Then
If (Target.Value <> "") And (Target.Offset(0, 1) <> "") Then
Col = CByte(Replace(Target.Offset(-2, -2), "Element ", ""))
If Feuil1.Cells(Col + 4, 5) = "Attention, date dépassée!" Then
MsgBox "envoi de mail"
End If
Clignote Feuil1.Range("D" & Col + 4)
End If
End If
End Sub
Option Explicit
Private Sub Worksheet_Activate()
Mail_small_Text_Outlook
End Sub
Private Sub Worksheet_Calculate()
Mail_small_Text_Outlook
End Sub
Sub Mail_small_Text_Outlook()
Dim strBody, ligne
Dim messagerie As Object
Dim email As Object
MsgBox "procédure d'envoi"
strBody = ""
For ligne = 5 To Cells(5, "F").End(xlDown).Row
If Cells(ligne, "E").Value = "Attention, date dépassée!" Then
strBody = strBody & "description : " & Cells(ligne, "F").Value & vbCrLf
End If
Next
Set messagerie = CreateObject("Outlook.Application")
Set email = messagerie.CreateItem(0)
With email
.To = "
mounir_kraim@hotmail.com"
.Subject = "Avertissement sur Tâche"
.body = strBody
.send
End With
Set email = Nothing
Set messagerie = Nothing
End Sub