Hello all,
I need to save an Excel worksheet to PDF and retain it's paper size of 11 x 17 landscape. Below is the macro I currently have and it runs but saves the pdf in 11 x 8.5. Any help is greatly appreciated.
Sub CreatePDF()
'Creates an individual workbook for each worksheet in the active workbook.
Dim wbSource As Workbook
Dim sht As Worksheet
Dim strPeriod As String
Dim sFileName As String
Application.Goto (ActiveWorkbook.Sheets("Sheet1").Range("b2"))
strPeriod = ActiveCell.Value
Application.ScreenUpdating = False
Set wbSource = ActiveWorkbook
Sheets("Sheet1").Select
Set sht = wbSource.Worksheets("Sheet1")
sFileName = "c:\Temp\Test\" & sht.Name & " " & strPeriod & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sFileName, Quality:=xlQualityStandard _
, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
I need to save an Excel worksheet to PDF and retain it's paper size of 11 x 17 landscape. Below is the macro I currently have and it runs but saves the pdf in 11 x 8.5. Any help is greatly appreciated.
Sub CreatePDF()
'Creates an individual workbook for each worksheet in the active workbook.
Dim wbSource As Workbook
Dim sht As Worksheet
Dim strPeriod As String
Dim sFileName As String
Application.Goto (ActiveWorkbook.Sheets("Sheet1").Range("b2"))
strPeriod = ActiveCell.Value
Application.ScreenUpdating = False
Set wbSource = ActiveWorkbook
Sheets("Sheet1").Select
Set sht = wbSource.Worksheets("Sheet1")
sFileName = "c:\Temp\Test\" & sht.Name & " " & strPeriod & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
sFileName, Quality:=xlQualityStandard _
, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False