Unable to set the PaperSize property of the PageSetup class (VBA)

AMagnan

New Member
Joined
Jun 11, 2014
Messages
1
Hello,

I'm trying to setup the PageSetup properties using VBA. All properties are working fine except the PaperSize property.
I've used all XlPaperSize constants (xlPaper11x17, xlPaperLetter, etc.) and nothing works. I've also used the matching numbers instead of the constants with the same result. I then recorded a macro to grab the value for the paper size and got 134 for 11x17 size. If I use that value then it works but 134 is not one of the possible values for XlPaperSize as specified in the documentation.
I'm a little bit confused as to what value I should be using. 134 works for me on my computer but it fails for another user on another machine for a different printer. 11x17 is supported on all printers.
What I need to do is to be able to set the page size to 11x17 and that it will work for all users on all computers for all printers.

Thank you for your help.
Alain
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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