Bonjour
j'ai un problème avec une macro valide sur une version excel 2003
elle ne fonctionne plus sur 2007
merci de votre aide
LA VALEUR DE CONFIGURATION SENDUSING EST NON VALIDE
Sub EnvoiMail()
Reponse = InputBox("Mot de passe")
If Reponse <> "MCD" Then
Exit Sub
Else
MsgBox ("Merci")
End If
'testé avec XP
Dim Fichier As String
Dim iMsg As Object, iConf As Object, iBP As Object
Const cdoSendUsingPickup = 1
Fichier = "Enregistrement " & Format(Date, "d mmmm yyyy") & " " & Format(Time, "h mm ss") & ".xls"
Application.ScreenUpdating = False
ThisWorkbook.Sheets("bussang").Copy 'creer un nouveau classeur contenant uniquement la feuille cible
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & Fichier
' enregistrement nouveau classeur (possibilité d'adapter le chemin et le nom du fichier)
ActiveWorkbook.Close 'fermer le classeur enregistré
'envoi mail
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "loubry.christophe@laposte.net " 'destinateire
.Subject = "résultat Novembre bussang " 'sujet
.HTMLBody = "Ci joint résultat de Novembre notre adresse email loubry.christophe@laposte.net <> Cordialement Christophe " 'corps du message
Set iBP = iMsg.AddAttachment(ThisWorkbook.Path & "\" & Fichier) 'piece jointe
.Fields("urn:schemas:mailheader:disposition-notification-to") = ""
.Fields("urn:schemas:mailheader:return-receipt-to") = "loubry.christophe@laposte.net"
.Fields.Update
.Send 'envoi
'l'envoi se fait sans message de confirmation et sans copie dans les elements envoyés
End With
j'ai un problème avec une macro valide sur une version excel 2003
elle ne fonctionne plus sur 2007
merci de votre aide
LA VALEUR DE CONFIGURATION SENDUSING EST NON VALIDE
Sub EnvoiMail()
Reponse = InputBox("Mot de passe")
If Reponse <> "MCD" Then
Exit Sub
Else
MsgBox ("Merci")
End If
'testé avec XP
Dim Fichier As String
Dim iMsg As Object, iConf As Object, iBP As Object
Const cdoSendUsingPickup = 1
Fichier = "Enregistrement " & Format(Date, "d mmmm yyyy") & " " & Format(Time, "h mm ss") & ".xls"
Application.ScreenUpdating = False
ThisWorkbook.Sheets("bussang").Copy 'creer un nouveau classeur contenant uniquement la feuille cible
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & Fichier
' enregistrement nouveau classeur (possibilité d'adapter le chemin et le nom du fichier)
ActiveWorkbook.Close 'fermer le classeur enregistré
'envoi mail
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "loubry.christophe@laposte.net " 'destinateire
.Subject = "résultat Novembre bussang " 'sujet
.HTMLBody = "Ci joint résultat de Novembre notre adresse email loubry.christophe@laposte.net <> Cordialement Christophe " 'corps du message
Set iBP = iMsg.AddAttachment(ThisWorkbook.Path & "\" & Fichier) 'piece jointe
.Fields("urn:schemas:mailheader:disposition-notification-to") = ""
.Fields("urn:schemas:mailheader:return-receipt-to") = "loubry.christophe@laposte.net"
.Fields.Update
.Send 'envoi
'l'envoi se fait sans message de confirmation et sans copie dans les elements envoyés
End With