Hi all,
I'm having trouble with the task of exporting all the worksheets in a workbook into a single PDF using VBA. I'm working on Excel 2011 for Mac.
I've come across several suggestions on the internet, including here, and none of them result in a single PDF file containing the worksheet contents.
Results in one PDF file per worksheet, named Sales + sheet name + pdf
Results in only the "Kettering" spreadsheet being exported to Sales.pdf
Results in a compiler error as ExportAsFixedFormat is not a method of SelectedSheets.
Results in only the last Worksheet being exported to Sales.pdf
I'm really baffled at this point. Is there any process that actually works and results in one PDF containing all the Worksheets in my Workbook?
Many thanks!
I'm having trouble with the task of exporting all the worksheets in a workbook into a single PDF using VBA. I'm working on Excel 2011 for Mac.
I've come across several suggestions on the internet, including here, and none of them result in a single PDF file containing the worksheet contents.
Code:
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPath & "\Sales.pdf", _
openafterpublish:=False, ignoreprintareas:=False
Code:
Sheets(Array("Bradford", "Kettering")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPath & "\Sales.pdf", _
openafterpublish:=False, ignoreprintareas:=False
Code:
Sheets(Array("Bradford", "Kettering")).Select
ActiveWindow.SelectedSheets.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPath & "\Sales.pdf", _
openafterpublish:=False, ignoreprintareas:=False
Code:
ActiveWorkbook.Sheets.Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPath & "\Sales.pdf", _
openafterpublish:=False, ignoreprintareas:=False
I'm really baffled at this point. Is there any process that actually works and results in one PDF containing all the Worksheets in my Workbook?
Many thanks!