Consulting

Results 1 to 6 of 6

Thread: Print PPT to PDF file

  1. #1
    VBAX Regular
    Joined
    Nov 2017
    Posts
    22
    Location

    Exclamation Print PPT to PDF file

    Hi, all. I have this one program where it can transfer the data from Excel to PowerPoint. I have to add another feature in my code that runs from Excel, which is to convert or print the active PPT file to PDF. The issue is I can't seem to find the solution for this. I only have a code that do the conversion but runs from PPT only, not Excel.

    Code that runs from PPT to convert PPT slides to PDF:
    Public Sub ExportAsFixedFormat_Example()
           ActivePresentation.ExportAsFixedFormat "C:\Users\my097a\Desktop\test.pdf", ppFixedFormatTypePDF, ppFixedFormatIntentScreen, msoCTrue, ppPrintHandoutHorizontalFirst, ppPrintOutputSlides, msoFalse, , , , False, False, False, False, False
    End Sub
    Hereby I attached my Excel file for you to refer to along with the PPT template. PowerPoint from Excel.xlsbTemplate.pptx

    May I also know how to add a feature in which user is prompted to select the folder of the pdf file to be saved and the user may name the pdf file as well?

    Hope anyone can enlighten me. Thanks!
    Last edited by macropod; 11-22-2017 at 08:40 PM. Reason: Merged related posts in Excel & PwrPt forums

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cross-posted at: https://www.excelforum.com/excel-pro...pt-to-pdf.html
    Please read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq...._new_faq_item3
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Regular
    Joined
    Nov 2017
    Posts
    22
    Location
    Hi macropod,

    How can I solve the issue then? Should I ask anyone to delete my thread?

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Kindly read the rules on both forums...
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    VBAX Regular
    Joined
    Nov 2017
    Posts
    22
    Location
    Yes, have read both.

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    You are using Late Binding in Excel. Since this does not include a reference to PPT the pp constants you use are meaningless in Excel

    You must define them:

    Const ppFixedFormatTypePDF As Long = 2
    Const ppFixedFormatIntentScreen As Long = 1
    Const ppPrintHandoutHorizontalFirst As Long = 2
    Const ppPrintOutputSlides As Long = 1
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Tags for this Thread

Posting Permissions

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