Sub envoi_Feuille_REV_3()
' Avant de lancer cette macro : Dans l'éditeur VBA, faire
' Menu / Outils / Références... /
' et cocher "Microsoft Outlook 11.0 Object Library"
Dim répertoireAppli As String, olapp As New Outlook.Application, msg As MailItem, s As String
Application.ScreenUpdating = False
répertoireAppli = ActiveWorkbook.Path
Sheets("plongée journalière ").Copy
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs répertoireAppli & "\Plongée du jour.xls"
Application.DisplayAlerts = True
ActiveWindow.Close
Application.ScreenUpdating = True
Sheets("Destinataires").Activate
Range("A11").Select
Do While Not IsEmpty(ActiveCell)
s = s & ActiveCell.Value & "; "
ActiveCell.Offset(1, 0).Select
Loop
s = Left$(s, Len(s) - 2)
Set msg = olapp.CreateItem(olMailItem) ' Envoi par mail
msg.To = s
msg.Subject = Range("A2").Value
msg.Body = Range("A5").Value & Chr(13) & Chr(13) & Range("A8").Value & Chr(13) & Chr(13)
msg.Attachments.Add répertoireAppli & "\Plongée du jour.xls"
msg.Send
End Sub