1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| If Mail = "Oui" Then
'Création du Pdf
Dim sNomPdf As String
Dim sDossier As String
Dim Destinataire As String
sDossier = ThisWorkbook.Path
sNomPdf = sDossier & "\" & "Synthese du processus " & Feuil9.Range("A2") & " _ Extraction du " & _
Replace(Replace(Replace(Left(Now, 16), ":", "h"), " ", " à "), "/", "-") & ".pdf"
Feuil9.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=sNomPdf, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
*
'Envoi du mail
On Error Resume Next: Set olapp = GetObject(, "Outlook.Application"): On Error GoTo 0
If olapp Is Nothing Then Set olapp = CreateObject("Outlook.Application")
End If
'Procédure de demande d impression
If Imprim = "OUI" Then
ActiveWindow.SelectedSheets.PrintOut Copies:=NbreCopie
End If
' Reprise de la macro jusqu'à la fin des processus sélectionnés
'Affichage feuille
Application.ScreenUpdating = True
'Protection de la feuille
ActiveSheet.Protect
Range("A9").Select |
Partager