Skip to main content
Participant
January 8, 2024
Question

help: macro to print an excel to pdf with 92x92 paper size

  • January 8, 2024
  • 1 reply
  • 412 views

I'm trying to script a n ecel macro to convert a xls file to pdf 92x92.

 

Dim newPrinter As String

newPrinter = GetPrinterFullName("AdobePDF")

Application.ActivePrinter = newPrinter

Workbooks.Open (InputfileName)

For Each sheet In Workbooks(InputfileName).Worksheets

sheet.PageSetup.PaperSize = ????

 

 

what kind of number do I have to use instead of "???".

With PdfCreator as a printer I used 162, now with  "Adobe Acrobat Pro DC 2015 version 2015.006.30172" this number dosesn't any more even if the paper size 92x92 is visible in the printer setting.

This topic has been closed for replies.

1 reply

Luke Jennings3
Community Expert
Community Expert
January 8, 2024

What is the original size of the excel file? I can't help you with your macro, but consider using an Acrobat preflight fixup to change the size of your pdf saved or exported (not printed*) from excel. You can duplicate an existing preflight profile from the little fly-out menu (Options), edit the settings and save the profile to a new name. You can use the profile in an Acrobat Action to quickly re-size your pdf. Tools> Print Production> Preflight> Fixups.

*print to pdf will probably result in an image file (not vector), producing a much larger pdf.