Printing mulitple PDF files

Chuck6475

Board Regular
Joined
Sep 30, 2012
Messages
126
Windows 7 - Excel 10 currently but initial started it with Excel 2003- I know enough to be dangerous. I have a good size Excel application running.

I'm using modified Dom Hill, June 2008 code to Create_PDFs. The code takes all of the sheets you want to print and combines them into one PDF. This works great as it allows me to use SendKeys to open Acrobat or Acrobat reader in full screen mode and produce a slide show on another monitor while data is added to the program. Create_PDFs requires Distiller, so any machine that uses the program has to have Acrobat too. $$$

I changed the output format to be more uniform which centralized the report data but made the PrintArea variable. Unfortunately I've found the PrintArea string is limited to 256 characters, significantly below what I can potential need.

When I went off to find a work around, I saw some code by Kenneth Hobson a subset of which is below which sent my mind into another direction. Can I eliminate Distiller? Can I have multiple PrintAreas defined for the same worksheet thereby sidestepping the 256 character limitation.

Code:
' Code by Kenneth Hobson
Sub PublishToPDF(fName As String, o As Object)
  Dim rc As Variant

  rc = Application.GetSaveAsFilename(fName, "PDF (*.pdf), *.pdf", 1, "Publish to PDF")
  If rc = "" Or rc = False Then Exit Sub
  
  o.ExportAsFixedFormat Type:=xlTypePDF, Filename:=rc _
  , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
  :=False, OpenAfterPublish:=False
End Sub

I haven't been able however to find answers to a few of questions I have.

1. Does the method used above require Acrobat/Distiller object library?

2. Is it possible to generate a multipage PDF using this method?

3. If one was to use an array of worksheet to be printed via this method, could the printArea for each worksheet be dynamical built.

Thanks in advance for your assistance.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Last edited:
Upvote 0

Forum statistics

Threads
1,215,201
Messages
6,123,617
Members
449,109
Latest member
Sebas8956

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