Bonjour,
Je m'excuse de mon étourderie. Des gens sont arrivés à l'improviste et ils m'ont déconcentré.
Voici donc ...
Sub RecordPDF()
'Ron de Bruin : 29-July-2017
'Test macro to save the ActiveSheet as pdf with ExportAsFixedFormat
'Note : if set it save the printarea
Dim FileName As String
Dim FolderName As String
Dim Folderstring As String
Dim FilePathName As String
'If my ActiveSheet is landscape, I must attach this line
'for making the PDF also landscape, seems to default to xlPortait
ActiveSheet.PageSetup.Orientation = ActiveSheet.PageSetup.Orientation
'Name of the folder in the Office folder
'''' FolderName = "PDFSaveFolder" ' changé ceci
FolderName = ThisWorkbook.Path ' pour cela
'Name of the pdf file
FileName = ActiveSheet.Name & " " & Format(Now, "dd-mmm-yyyy hh-mm-ss") & ".pdf"
'''' Folderstring = CreateFolderinMacOffice2016(NameFolder:=FolderName) ' changé ceci
'''' FilePathName = Folderstring & Application.PathSeparator & FileName ' et ceci
FilePathName = FolderName & Application.PathSeparator & FileName ' pour cela
'expression A variable that represents a Workbook, Sheet, Chart, or Range object.
'the parameters are not working like in Excel for Windows
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
FilePathName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False
MsgBox "You find the PDF file in this location : " & FilePathName
End Sub
ric