+ Reply to Thread
Results 1 to 3 of 3

Convert all Powerpoint files into PDF from an Excel VBA

  1. #1
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Convert all Powerpoint files into PDF from an Excel VBA

    hi guys. From an excel file, can I do a vba code to convert all powerpoint files in the same folder as the excel file into pdf files? The only exception is if the powerpoint file name is "abc.pptx". thanks in advance!

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Convert all Powerpoint files into PDF from an Excel VBA

    Hi,

    It took a little more work than I had anticipated. I was hoping to use the ExportAsFixedFormat method, which works fine when used in PowerPoint, but seems to generate runtime errors when controlling PowerPoint from Excel. Other users have experienced the same problem. In my research, I did not come across a solution.

    Fortunately, I had success with the SaveAs Method, which has almost no options, and must save the entire file as pdf.

    ExportAsFixedFormat Method reference: https://msdn.microsoft.com/en-us/lib.../ff746080.aspx
    SaveAs Method reference: https://msdn.microsoft.com/en-us/lib.../ff746389.aspx

    I used 'Late Binding' which requires no Library references, but requires that all PowerPoint constants be explicitly declared. 'Early Binding' vs. 'Late Binding' reference: http://peltiertech.com/Excel/EarlyLateBinding.html

    The software was developed in Excel 2003 (which can NOT create pdf files, but simulates their creation). The software was successfully tested using 32 bit Excel 2010.

    See the attached file which contains the following code in ordinary code module ModSavePptAsPdf:
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Convert all Powerpoint files into PDF from an Excel VBA

    didn't think it would be so complicated. thank you very much for this, Lewis!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Convert Embedded PowerPoint Chart to Excel
    By deturnbull in forum Excel General
    Replies: 9
    Last Post: 03-27-2022, 11:33 AM
  2. Windows 7 :Need to convert PDF files to PowerPoint,Any suggestion?
    By hourer in forum Microsoft Windows Help
    Replies: 6
    Last Post: 03-11-2016, 06:30 AM
  3. How to Convert Excel Graphs into the PowerPoint Slides for specified ranges
    By ctguards1987 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2014, 09:08 AM
  4. Replies: 1
    Last Post: 05-14-2014, 09:08 AM
  5. how to convert excel worksheet to a powerpoint slide
    By awcrutch in forum Excel General
    Replies: 2
    Last Post: 07-27-2006, 12:50 PM
  6. [SOLVED] How to convert an excel spreadsheet into a Powerpoint page?
    By Sara in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2006, 04:20 PM
  7. Replies: 1
    Last Post: 06-08-2005, 11:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1