Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 29

Thread: Article: Printing Worksheets To A PDF File (Using Early Binding)

  1. #1
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,250
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider

    Article: Printing Worksheets To A PDF File (Using Early Binding)



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training) or with my book M is for Data Monkey!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  2. #2
    Neophyte Anbarasan Gopal's Avatar
    Join Date
    Apr 2013
    Location
    kallakurichi
    Posts
    2
    Articles
    0
    i installed in pdf creator 0.9.1 and the macro show error in VBA Code
    Message " Dim pdfjob As PDFCreator.clsPDFCreator " script error

    iam using office 2003
    OS - windows xp3

    Please help


  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,250
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Sounds like you might need to set a reference to the PDFCreator library.

  4. #4
    Good code.
    Can someone please help me on these
    1. sometimes the file created gives an error when opened with Adobe.
    2. I cannot find settings so the file is open in PDF after it is saved.

  5. #5
    Thank you so much. This is clean reliable code that worked well immediately. Also good error checking etc. so should be easy to use. I had failed to find such a good solution in the past and ended up with a messy solution. Will now re-write to improve. Thanks again.

    It was easy to change from whole page to selected range...

    changed from ActiveSheet.Printout
    into Range("A14").Printout

  6. #6
    Dear Ken,

    tried to use your script that day. It creates the pdf from the vb-editor in the specified folder but the macro won't stop to run. The whole Excel-application becomes blocked that way.
    If I run the macro from the Excel Interface, the file is not even created...
    I installed 1.2.0 on Windows 7. What coud be the cause here?

    Thank you...!

  7. #7
    Happy new year!
    Sorry for my previous lines. I figured out how to run the brilliant code now. Obviously, my mistake has been, that I wanted to run the code in an existing Sub: Then it gets stuck in the Do...Loop?
    Whn the the code is called in a separate Sub handing over the file name and path variables it works great! Thank you!

  8. #8
    Thanks for the code. I currently have a spread sheet saving to a location with the name based on the content of a cell. I need to prevent the user from saving over any existing files with the same name in this location with a prompt stating "file already exists" and then for it to exit the macro without doing anything else. Could you please provide any assistance?

    Many Thanks.

  9. #9
    Hi.
    I found this wonderful code ( Print a Single Worksheet to a PDF File ) and it works brilljantly, but I have a small problem. When I change the line

    sPDFPath = ActiveWorkbook.Path & Application.PathSeparator
    to sPDFPath = "E\Report" witch is the dir I want to use,

    the program gets stuck in a loop here....

    'Wait until the file shows up before closing PDF Creator Do DoEvents Loop Until Dir(sPDFPath & sPDFName) = sPDFName

    The file shows up in the folder and is readable but excel is stuck in this loop.
    Please help me. I am not a Excel guru

  10. #10
    (Print Specified Worksheets to a Single PDF File) super code! thanks a lot. I want to know how or where , I can activate the Option "OpenAfterPublish=True" or other Option that at the end open the merged pdf. Thanks in advance for your help.

Page 1 of 3 1 2 3 LastLast

Posting Permissions

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