+ Reply to Thread
Results 1 to 14 of 14

How to use excel vba to open powerpoint and save as powerpoint picture presentation

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    How to use excel vba to open powerpoint and save as powerpoint picture presentation

    Hi All,
    I've been trying to sift through the forums for this but haven't found a reference to what I need. And given that i'm fairly new to vba, the options i've tried thus far in my code just result in errors.
    The goal: Use an excel macro to Open a powerpoint file, update links, save as powerpoint picture presentation, close. I think I got everything other than the SaveAs working fine.

    the code i have thus far:
    Please Login or Register  to view this content.
    I have no idea how to make the save as into save as powerpoint picture presentation... any ideas or insight would be greatly appreciated!

    Thanks you!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    Welcome to the Forum!

    What is a "picture presentation"? You can specify the file type like this
    Please Login or Register  to view this content.
    There is no "picture presentation" file type. The available values for FileType are:

    ppSaveAsAddIn
    ppSaveAsBMP
    ppSaveAsDefault
    ppSaveAsGIF
    ppSaveAsHTML
    ppSaveAsHTMLDual
    ppSaveAsHTMLv3
    ppSaveAsJPG
    ppSaveAsMetaFile
    ppSaveAsPNG
    ppSaveAsPowerPoint3
    ppSaveAsPowerPoint4
    ppSaveAsPowerPoint4FarEast
    ppSaveAsPowerPoint7
    ppSaveAsPresentation
    ppSaveAsRTF
    ppSaveAsShow
    ppSaveAsTemplate
    ppSaveAsTIF
    ppSaveAsWebArchive
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    When using powerpoint 2010 directly and going to file save as in the drop down for file type there is an option for powerpoint picture presentation...the extension is still pptx but all the slides are converted to pictures. In my case this is necessary because all my slides are links and I need to email the presentations with a snapshot of the data without it being changeable and without broken links.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    I found what you are talking about and was able to do a manual save to that format. However, PowerPoint no longer has a macro recorder, and that file type is not listed in the documentation for SaveAs or SaveCopyAs, so I am at a dead end. Sorry I couldn't be of more help.

    BTW in the code above where I wrote FileType should be FileFormat.

  5. #5
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    Could it perhaps be 'ppSaveAsOpenXMLPicturePresentation' (value 36)
    If you like my contribution click the star icon!

  6. #6
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    Awsome Thanks guys that worked! I actually had to enable the powerpoint object library in order to allow setting a fileformat. and then the ppSaveAsOpenXMLPicturePresentation worked! Thanks for both of your help!

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    I tested OllieB's suggestion and confirmed that this indeed is the answer! That value was not listed in my Help documentation, where did you find it?

    Please Login or Register  to view this content.

  8. #8
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    Quote Originally Posted by 6StringJazzer View Post
    I tested OllieB's suggestion and confirmed that this indeed is the answer! That value was not listed in my Help documentation, where did you find it?

    Please Login or Register  to view this content.
    I opened a VBA module, created a dummy routine and typed active presentation.saveas and it showed me the possible parameter values.

    I had also provided the numerical value of this parameter to use in late binding. Setting a project reference to PowerPoint was not needed

  9. #9
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    I just realized that the .ActivePresentation.UpdateLinks isn't working... any ideas why/how to fix that?

  10. #10
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    The statement is correct Application.ActivePresentation.UpdateLinks so that cannot be the problem. How did you conclude it is not working? What is you try to run the command manually from the Immediate window in the presentation while debugging the code?

  11. #11
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    Well I checked the powerpoint picture presentation that it created and saw the the data wasn't the most recent data in the saved excel file that the charts were linked to. i then manually ran the macro and commented out the saveas, quit portions so that the powerpoint would be left open and i didnt see the data change. When i manually right clicked on the link and selected update link I did see the data change...

  12. #12
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    Ok, same trick. Comment out the save and quit. In the open presentation switch to the VBA editor window, and type ActivePresentation.UpdateLinks in the Immediate window - see what happens

  13. #13
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    You may have to use a different approach.

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    01-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How to use excel vba to open powerpoint and save as powerpoint picture presentation

    hmm, yeah when i did updatelinks in powerpoint directly it also didnt' do anything. Okay i will try what you suggest in your last post and see if that works. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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