Consulting

Results 1 to 20 of 24

Thread: Solved: Printing multiple worksheets to a single pdf file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PDFCreator is only included because according to the author of the code it will only work with it, I have no clue why.

    A few questions:
    third line of code, why does it only say "sheet1" (or is this the code that locates the button?)

    4th and 6th line of code: "on cpw2" is that the server where you have cutepdf running? if that is the case, then this line needs to be different for each user (if they have a different program or on a different server)
    is that correct? If so then i'll need to figure out how to bypass that.

    I'm going to try to insert it into my (test) workbook, and see what happens


  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,718
    Location
    My test workbook had Sheet1, ..., Sheet5; if you want to try this, you'd need to adapt it to your names.

    Similarly, the PDF "printer" here is configured differently.

    I was testing if it were possible to select multiple worksheets and then print them to one PDF file using a single "Print" instead of trying to print individual sheets and joining them into a PDF

  3. #3
    Quote Originally Posted by Paul_Hossler
    My test workbook had Sheet1, ..., Sheet5; if you want to try this, you'd need to adapt it to your names.

    Similarly, the PDF "printer" here is configured differently.

    I was testing if it were possible to select multiple worksheets and then print them to one PDF file using a single "Print" instead of trying to print individual sheets and joining them into a PDF
    I did the adaptation with the names, that was my test situation..... this isn't as easy as thought.

    @ charlize, there seems to be no activity in pdfcreator, it saves nothing, but also there is no doc qeued

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,718
    Location
    When I use the PDF "printer" here it asks me for a file name

    Instead of looping to add WS to a PDF file, I was able to select multiple sheets and print them all to a file.

    As an experiment, you could start to record a macro, select all your sheets (control+click) at once, and then File, Print selecting your PDF printer.

    I got the code fragment in my earlier answer, and guessed at how your macro might look.

    [vba]
    Worksheets(Array("Information", "IPL Service", "Signatures and pricing")).Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="PDFCreator", Collate:=True
    [/vba]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •