morning,
I have the following code which exports a selected range of tabs and exports to pdf:
'selects sheets
Dim myArray, x As Long
'If Range("guidance") = 1 Then
myArray = Array("Validation", "Cover sheet", "Guidance", "Front page", "Graphs with food", "P&L - presentation", _
"P&L - comparative", "P&L - prior year comparative", "Balance sheet - presentation", "Financial analysis", "Sales analysis - with food", "Sales analysis - without food", "Tax projection - director 1", "Tax projection - director 2", "Tax calculations")
'x = Sheets("input sheet").Range("b47").Value
'Else
myArray = Array("Validation", "Cover sheet", "Guidance", "Front page", "Graphs with food", "P&L - presentation", _
"P&L - comparative", "P&L - prior year comparative", "Balance sheet - presentation", "Financial analysis", "Sales analysis - with food", "Sales analysis - without food", "Tax projection - director 1", "Tax projection - director 2", "Tax calculations")
'x = Sheets("input sheet").Range("b47").Value
'End If
ReDim Preserve myArray(UBound(myArray) - 2 + x)
Sheets(myArray).Select
Selection.Activate
Application.StatusBar = "Generating email for review..."
' pdfName = "TESTWORKBOOK"
' ChDir ActiveWorkbook.Path & "\"
' fileSaveName = ActiveSheet.Name
'
' ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
' fileSaveName _
' , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
' :=False, OpenAfterPublish:=True
'
' MsgBox "File Saved " & " " & fileSaveName
'*********************************
' This determines the Title of the PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
myPath & "Management Accounts - " & Format(Date, "dd_mm_yyyy") & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, openafterpublish:=False
The problem I am having is that the page sizes of the pdfs (supposed to be all A4) are completely different. Some are at least 5 times the size of the previous or subsequent pages.
Has anyone seen this before?
When I select the pages manually and print to pdf everything is fine?
thanks in advance.
Dan.
Bookmarks