Sub CreatePDFSheet()
'Ron de Bruin, 1-June-2012
Dim TempPDFFolder As String
Dim PDFfolder As String
Dim PDFfileName As String
'Path to folder where we save the pdf's temporary. The code will create
'the folder named "PDFTempFolder" in your Documents folder for you
'Note: this will not be used when you create a pdf of one sheet but not remove this line
TempPDFFolder = MacScript("return (path to documents folder) as string") & "PDFTempFolder:"
'Folder where you want to save the PDF file, Documents folder in this example
'PDFfolder = MacScript("return (path to documents folder) as string")
'''''''Ici tu active cette ligne si tu veux avoir le choix du dossier et tu désactive celle du dessous
'PDFfolder = MacScript("choose folder as string")
'''''''Personalisé le dossier ou sera enregistré le PDF --> celui ci est le miens en exemple
PDFfolder = "Machintoch HD:Users:ton user:Documents:Factures:"
'Enter the file name that you want to use for the PDF, do not add the extension.
'''''''''' La personalise les information du classeur a enregistré ---> comme ci dessous
PDFfileName = Worksheets("Facture").Range("NomClient") & " " & "Facture" & " " & Range("NumFact") & " " & "Du" & " " & Range("DateFact") 'Format(Now, "dd/mmm/yyyy")
Application.ScreenUpdating = False
'You can also use this for the activesheet : ActiveSheet.Copy
''''''Ici indiqué la feuille a créée en PDF
Worksheets("Facture").Copy
'Do not change the macro call below, you see that we only have one macro call
'if we create a PDF of one sheet because we not have a problem with the bug that
'create a pdf of each worksheet in the workbook because there is only one sheet.
Call MakePDF(TempPDFFolder, PDFfolder, PDFfileName, True)
'Close temporary file
ActiveWorkbook.Close SaveChanges:=False
Application.ScreenUpdating = True
End Sub