Option Explicit
Option Base 1
Sub EnregistrerEnPDF()
Dim Str_Periode As String
Dim Str_Choix As String
Dim chemin$
chemin = ThisWorkbook.Path
Set Ws_Source = Worksheets("AUTORISATIONS")
With Sheets("Déclarations")
.CheckBox1.Value = IIf(S_Totale_Declaree = 0, True, False)
.CheckBox2.Value = IIf(S_Totale_Declaree = 0, False, True)
.Lbl_NomPrenom1.Caption = Ws_Source.Cells(2, 1) & " " & Ws_Source.Cells(2, 2) & " " & Ws_Source.Cells(2, 3)
.Lbl_Adresse.Caption = Ws_Source.Cells(2, 4) & " " & Ws_Source.Cells(2, 5) & ", " & Ws_Source.Cells(2, 6) & " " & Ws_Source.Cells(2, 7)
.Lbl_Identifiant.Caption = Ws_Source.Cells(2, 9)
'.Lbl_MoisEnCours.Caption = Application.Proper(Format(DateSerial(Year_Select, Month_Select, 1), "mmmm")) 'Month_Actuel
.Lbl_MoisEnCours.Caption = IIf(Str_Periode = "A-", "Résultats de l'Année : " & Str_Choix, _
IIf(Str_Periode = "TR-", "Résultats du Trimestre n° " & Str_Choix, _
"Pour le Mois de : " & Application.Proper(Format(DateSerial(Year_Select, Str_Choix, 1), "mmmm"))))
.Lbl_CAVenteMarchandise.Caption = Format(CCur(S_Txt_VenMar_1), "### ### ##0.00") 'on colle la somme des Ventes
.Lbl_CAPrestationService.Caption = Format(CCur(S_Txt_ServComArt_1), "### ### ##0.00")
.Lbl__CAAutrePrestatService.Caption = Format(CCur(S_Txt_AutPrestaServ_1), "### ### ##0.00")
.Lbl__MoisEnCours2.Caption = Application.Proper(Format(DateSerial(Year_Select, Month_Select, 1), "mmmm")) 'Month_Actuel
.Lbl__Lieu.Caption = "Fait à " & Ws_Source.Cells(2, 7) & " ,le " & Application.Proper(Format(Date, "dddd dd mmmm yyyy")) 'Month_Actuel
.Lbl_NomPrenom2.Caption = Ws_Source.Cells(2, 1) & " " & Ws_Source.Cells(2, 2) & " " & Ws_Source.Cells(2, 3)
End With
ThisWorkbook.Sheets("Déclarations").ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=chemin & "\" & "Pole Emploi-Attestation sur l'honneur-" & Year_Select & "-" & Application.Proper(Format(DateSerial(Year_Select, Month_Select, 1), "mm")) & ".pdf" '" " & Month_Select & ".pdf"
S_Txt_VenMar_1 = 0: S_Txt_ServComArt_1 = 0: S_Txt_AutPrestaServ_1 = 0
Set Ws_Source = Nothing
End Sub