![]() ![]() Sh.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _ 'File name is the sheet name and a date/time stampįileName = sh.Name & " " & Format(Now, "dd-mmm-yyyy hh-mm-ss") & ".pdf"įilePathName = Folderstring & Application.PathSeparator & Fstr & Application.PathSeparator & FileName Sh.PageSetup.Orientation = sh.PageSetup.Orientation 'If the sheet is visible then publish it to PDF If TestStr = vbNullString Then MkDir Folderstring & "/" & Fstr TestStr = Dir(Folderstring & "/" & Fstr, vbDirectory) 'Create folder in the Root folder with the name of the ActiveWorkbookįstr = Mid(ActiveWorkbook.Name, 1, InStrRev(ActiveWorkbook.Name, ".",, 1) - 1) & Format(Now, " dd-mmm-yyyy hh-mm-ss") 'Name of the Root folder in the Office folder, and create the folder 'It will create a new folder for you with the files 'Test macro to publish each worksheet to pdf with ExportAsFixedFormat Sub PublishEachWorkSheetToPDFInMacExcel2016() Range("A1:C20").ExportAsFixedFormat Type:=xlTypePDF, FileName:= _ 'Test macro to save the Range A1:C20 as pdf with ExportAsFixedFormatįileName = ActiveSheet.Name & " Range " & Format(Now, "dd-mmm-yyyy hh-mm-ss") & ".pdf" 'Test macro to save the ActiveSheet as pdf with ExportAsFixedFormatįileName = ActiveSheet.Name & " " & Format(Now, "dd-mmm-yyyy hh-mm-ss") & ".pdf"ĪctiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _ MsgBox "You find the PDF file in this location : " & FilePathName IncludeDocProperties:=True, IgnorePrintAreas:=False 'the parameters are not working like in Excel for WindowsĪctiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _įilePathName, Quality:=xlQualityStandard, _ ![]() 'expression A variable that represents a Workbook, Sheet, Chart, or Range object. 'for making the PDF also landscape, seems to default to xlPortaitĪ = įileName = ActiveWorkbook.Name & " " & Format(Now, "dd-mmm-yyyy hh-mm-ss") & ".pdf"įolderstring = CreateFolderinMacOffice2016(NameFolder:=FolderName)įilePathName = Folderstring & Application.PathSeparator & FileName 'If my ActiveSheet is landscape, I must attach this line All sheets seems to follow the orientation of the activesheet(Bug) 'Test macro to save the ActiveWorkbook as pdf with ExportAsFixedFormat Sub SaveActiveWorkbookAsPDFInMacExcel2016() 'Note: the 4 macros below use the CreateFolderinMacOffice2016 function that is on the bottom of this module ![]()
0 Comments
Leave a Reply. |