Bonsoir,
Comme le nom du sujet l' indique je bloque sur l' insertion de ce code dans ma macro pour pouvoir sauvegarder mon fichier en .PDF.
Code :
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
Ma macro :
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Dim Chemin As String, Fichier As String, Rep As String
Chemin = "D:\SARL\Devis\"
Rep = Application.Proper(MonthName(Month(Date))) & " " & Year(Date)
On Error Resume Next
MkDir Chemin & Rep
On Error GoTo 0
Chemin = Chemin & Rep & "\"
Sheets("Devis").Copy
Fichier = Sheets("Devis").Range("C4") & " " & "F" & Format(Date, "ddmmyyyy") & ".xlsx"
With ActiveWorkbook
.SaveAs Filename:=Chemin & Fichier
.Close
Application.DisplayAlerts = True
MsgBox ("Enregistré dans le dossier -Devis-")
End With
End Sub
J'ai lu plusieurs post sur le sujet mais tout mes essais ont aboutis a des erreurs.
Une âme charitable pourrait-elle me venir en aide ?
Cordialement.