October 22, 2024
Chicago 12, Melborne City, USA
pdf

VBA to generate a pdf on 11×17 errors out?


I’m missing something really basic here I’m sure. I have an excel file where I want to create a pdf (or print) with certain columns shown, landscape, various formattings… on an 11×17. Everything works just great- it can make a pdf or print to the local printer as an 8.5×11, but declaring ‘sheet.pagesetup.papersize = xlPaper11x17’ causes the code to error out.

Is there another setting I need to change somewhere like ‘disable auto select paper size’? I’ve tried ‘xlpaperTabloid’ as well but same result.

code auto-completed while typing, so I’m not mistyping.

Edit: to add even more confusion to this, it worked fine the other day with sheet.pagesetup.papersize = xlPaperTabloid (xl11x17 throws an error despite it being an option) but now today the code crashes when it gets to that line.

There is something REALLY wrong with how our printers here are configured, which might lead to this issue…? There are 3 different locations I have to change ‘paper size’ when printing ANY document and if all 3 don’t agree it tends to do what it wants. I believe the code above generates what I want correctly IFF the last thing I printed was Tabloid-sized. Any ideas would be GREATLY appreciated because nothing about this makes any sense on the code side not working.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video