envoi cclasseur par mail

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

MASSJIPE

XLDnaute Impliqué
Bonjour
Y a t'il un moyen de contourner le message lors d'un envoi par mail
d'un classeur Voir photo
SI X destinataires à chaque fois il dire oui
Merci
Sub envoi_Feuille()
répertoireAppli = ActiveWorkbook.Path ' Penser à Outils/Références Outlook
Sheets("ROVSTR").Copy ' crée un classeur avec la feuille résultats
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs répertoireAppli & "\ROVSTR.xls"
ActiveWindow.Close
'--- Envoi par mail
Dim olapp As Outlook.Application
Sheets("destinataires").Select
Range("A11").Select
Do While Not IsEmpty(ActiveCell)
Dim msg As MailItem
Set olapp = New Outlook.Application
Set msg = olapp.CreateItem(olMailItem)
msg.To = ActiveCell.Value
msg.Subject = Range("A2").Value
msg.Body = Range("A5").Value & Chr(13) & Chr(13) & Range("A8").Value & Chr(13) & Chr(13)
msg.Attachments.Add Source:=répertoireAppli & "\ROVSTR.xls"
msg.Send
ActiveCell.Offset(1, 0).Select
Loop
End Sub
Sub lit_messagerie()
Dim olapp As Outlook.Application 'penser à Outils/Références Outlook
Dim olns As Outlook.NameSpace
Dim olmf As Outlook.MAPIFolder
Dim obj As Object
Set olapp = New Outlook.Application
Set olns = olapp.GetNamespace("mapi")
Set olmf = olns.GetDefaultFolder(olFolderInbox)
For Each obj In olmf.Items
MsgBox obj.Subject
Next
End Sub
 

Pièces jointes

  • Sans titre.jpg
    Sans titre.jpg
    12.1 KB · Affichages: 42
  • Sans titre.jpg
    Sans titre.jpg
    12.1 KB · Affichages: 40
  • Sans titre.jpg
    Sans titre.jpg
    12.1 KB · Affichages: 40
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
2
Affichages
809
  • Question Question
Microsoft 365 Code VBA
Réponses
7
Affichages
819
Réponses
10
Affichages
547
Réponses
4
Affichages
461
Retour