VBA for Print to PDF custom page size

gli

Board Regular
Joined
Jun 8, 2006
Messages
96
Hello all. I have a file that I would like to print to PDF that would always print only one page wide but print to the length I select with "Set print area" without extraneous white areas on the sides. I have a picture file embedded in the background with a custom header. This picture file is one page wide, but it is long enough to accommodate increases in spreadsheet length as necessary. The problem I am having is that when the file prints to PDF it is shrinking the page down to fit to the paper size I'm forced to choose, and that is leaving me with a bunch of unwanted white space on the sides. I don't have Acrobat to be able to crop the white space out, and other workarounds I've tried have negatively impacted the visual quality of the PDF file (ie, they get blurry). The problem to me seems to stem from the fact that I can't set a custom page size and that my length is dynamic and will always vary from print to print. I am looking for VBA that will enable me to end up with a PDF file that is always one page wide with no white space at the length specified with my print area. Any help would be appreciated!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hello all. I have a file that I would like to print to PDF that would always print only one page wide but print to the length I select with "Set print area" without extraneous white areas on the sides. I have a picture file embedded in the background with a custom header. This picture file is one page wide, but it is long enough to accommodate increases in spreadsheet length as necessary. The problem I am having is that when the file prints to PDF it is shrinking the page down to fit to the paper size I'm forced to choose, and that is leaving me with a bunch of unwanted white space on the sides. I don't have Acrobat to be able to crop the white space out, and other workarounds I've tried have negatively impacted the visual quality of the PDF file (ie, they get blurry). The problem to me seems to stem from the fact that I can't set a custom page size and that my length is dynamic and will always vary from print to print. I am looking for VBA that will enable me to end up with a PDF file that is always one page wide with no white space at the length specified with my print area. Any help would be appreciated!
Check if this help
 
Upvote 0

Forum statistics

Threads
1,224,752
Messages
6,180,742
Members
452,996
Latest member
nelsonsix66

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