Help! PDF prints out to a different size than print preview?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,
ok a very confusing problem here.
I have a Macro that save a tab as a PDF, (See macro below)
The problem I have is that it doesn't save the PDF in the same page sizes as I see in print preview
I'm trying to get the document to save as a PDF using the printer settings I have but its not doing it,
I want it to save as "Letter" size but it seams to be saving the PDF as A4 which is the UK standard size.

Any ideas how I can get it to Save as letter size or save as if it was printing but to PDF?

The macro I'm using is this:

Code:
Sub ExportAsPDF3()
ActiveSheet.Unprotect
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=ActiveWorkbook.Path & "\" & ActiveSheet.Range("L1").Value & Format(Now, "MM-DD-YYYY") & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
        :=False, OpenAfterPublish:=True
ActiveSheet.Protect
 Range("Am11").Select
End Sub

any help would be great

thanks

Tony
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
For me in Excel 2010 the PDF has exactly the same print settings as those for the ActiveSheet in Excel, including paper size. Are you sure that you have set it to Letter?
 
Upvote 0
Hi yes, its set on letter as when I look at print preview or even print out its perfect, but when I run the macro the pages are a different size?
it very strange, I've been trying to sort it out for days now but cant get anywhere!
I'm in 2013,
I was hoping someone would know what I'm doing wrong?
 
Upvote 0
Well I guess for now I'll stick to my very Heath Robinson way of fixing it,
I added to the macro a copy sheet function, then on the copied tab reset the page breaks, select the page breaks I want and create the pdf from the copied tab then when its done it deletes the copied tab, problem solved.
I guess it will be one of those strange little bugs I'll never properly fix, but this works so it will have to do.

thanks
for testing and trying to sort it out for me.
Tony
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top