Public c As String
Public cc As String
Public chem As String, pos&
Public ccc As String
Sub valeursvariables()
c = Mid(ThisWorkbook.Path, 1, InStrRev(ThisWorkbook.Path, "\") - 1)
cc = Mid(c, 1, InStrRev(c, "\") - 1)
Dim chem As String, pos&
chem = ActiveWorkbook.Name
pos = InStr(chem, ".")
ccc = Left(chem, pos - 1)
End Sub
Sub Export_Acte()
'
Application.ScreenUpdating = False
On Error Resume Next
Call valeursvariables
Sheets("TCD-Acte").Activate
Call format_page
ActiveWorkbook.Save
ActiveSheet.PivotTables("TCD_Acte").TableRange1.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
cc & "\" _
& "Pièces jointes" & "\" & ccc & "\" & Range("F1").Value & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Sheets("Menu").Activate
MsgBox ("Fichier enregistré en Pièces jointes")
Application.ScreenUpdating = True
End Sub