Option Explicit
Sub Onglet_en_PDF()
Application.EnableEvents = False
Application.ScreenUpdating = False
If [G14] = "?" Or [G14] = "" Then
MsgBox ("Merci de répondre en haut de page : etc... ?")
Range("G14").Select
ActiveWindow.LargeScroll Down:=-1
Exit Sub
End If
'Else
If [E61] = "" Then
MsgBox ("Merci de valider votre accord")
Range("E61").Select
Exit Sub
End If
Call ImportSignatureIsitel
ActiveSheet.Unprotect Password:=""
Range("b" & Rows.Count).End(xlUp)(2).Value = Environ("username") & " - " & Environ("COMPUTERNAME")
Range("b" & Rows.Count).End(xlUp)(2).Value = "Bon pour accord, le " & Date & " à " & Time
Range("b" & Rows.Count).End(xlUp)(2).Select
ActiveSheet.Protect Password:="", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
Dim Chemin As String, Fichier As String, NomFichier As String, site As String, nom As String, Matricule As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
site = "accord Partenariat isiTel"
'Site = Me.Range("A1").Value
nom = Range("G67")
Matricule = ""
NomFichier = nom & " " & site & " " & Matricule & ".pdf"
Chemin = ThisWorkbook.Path
ChDir Chemin 'se place sur le repertoire du programme
Fichier = Chemin & "\" & NomFichier
If Dir(Fichier) <> "" Then If MsgBox("Le fichier existe déjà," & Chr(10) & _
"Voulez-vous l'écraser?", vbYesNo) = vbNo Then GoTo suite:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Fichier, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
MsgBox "Votre PDF est enregistré à l'emplacement de votre classeur ""Partenariat isiTel"". Opération terminée !", vbInformation
suite:
ActiveSheet.Unprotect Password:=""
ActiveSheet.Shapes.Range(Array("Image 1")).Select
Selection.Cut
ActiveSheet.Protect Password:="", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub