+ Reply to Thread
Results 1 to 27 of 27

Open correct version of Powerpoint with VBA

  1. #1
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Open correct version of Powerpoint with VBA

    I have both Office 2010 and Office 2016 on my PC
    When I double-click on a file name it always opens the file with PowerPoint 2016 ( this is what I want)

    But I also want to open a presentation from Excel using VBA
    I use the code below which works BUT the file is opened in Powerpoint 2010 - ( I want it to open with PowerPoint 2016)

    Please Login or Register  to view this content.
    So what needs to be changed make VBA open the file in PowerPoint 2016?

    thanks
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Open correct version of Powerpoint with VBA

    The PowerPoint Reference in the Tools/References menu... You need PP 16, it probably references PP14

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Open correct version of Powerpoint with VBA

    Hi, if always want to open Powerpoint 2016 you can do that in Windows explorer, search of a pp file and right click open with and choose 2016 and set it to always use 2016.
    If not, you will have to code both paths to Powerpoint:

    C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE
    or
    C:\Program Files (x86)\Microsoft Office\Office16\POWERPNT.EXE
    In my case it's 32-bit Office ; C:\Program Files\.... with 64-bit Office
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    @cytop - thanks for suggestion but that's not the problem

    pp16.jpg

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Open correct version of Powerpoint with VBA

    Try my idea

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Open correct version of Powerpoint with VBA

    So much for VBA updating references to the latest version automatically...

    Would be interested myself to know what happens if you use Late Binding rather than Early Binding.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    @cytop - it returns 14.0
    which you expected

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Open correct version of Powerpoint with VBA

    https://stackoverflow.com/questions/...-2010-in-excel

    same concept but with word
    try method mentioned by SeanC
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    @Keebellah thanks for your suggestion
    Hi, if always want to open Powerpoint 2016 you can do that in Windows explorer, search of a pp file and right click open with and choose 2016 and set it to always use 2016.
    This has already been done that is why clicking on files automatically opens in PowerPoint2016

    How do I incorporate your other suggestion into my code?
    C:\Program Files (x86)\Microsoft Office\Office16\POWERPNT.EXE
    For some reason, my path is C:\Program Files (x86)\Microsoft Office\root\Office16
    Last edited by kev_; 07-20-2017 at 04:01 AM.

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Open correct version of Powerpoint with VBA

    The VBA code you show means that one version is already opened.
    What you need is like a vbs script that gives you the choice BEFORE any version or PowerPoint is opened.

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Open correct version of Powerpoint with VBA

    If you take a look here (it's for Excel) you will get the idea
    link removed

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,872

    Re: Open correct version of Powerpoint with VBA

    Please don't link to other Excel forums. Give the required information here within the thread. Thanks!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  13. #13
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Open correct version of Powerpoint with VBA

    I do not think it's a good idea to paste the entire post content.
    What's the problem with a link?

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,872

    Re: Open correct version of Powerpoint with VBA

    Rule #13a. Please post the relevant code here. Thanks.

  15. #15
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Open correct version of Powerpoint with VBA

    What about using the Shell command to open the file in PowerPoint, then set your PowerPoint object?

    For my machine, this is where PP is located:
    Please Login or Register  to view this content.

  16. #16
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    The correct version of PowerPoint opens if code begins with this line:
    Please Login or Register  to view this content.
    What do I need to add in my Excel macro for it to open D:\Documents\myPresentation.pptm and set the opened presentation to variable PPpres?

  17. #17
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    thanks @cebalaw - we were typing at the same time - I will try your suggestion

  18. #18
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Open correct version of Powerpoint with VBA

    Is that not what I just wrote?
    It didn't work for you?

  19. #19
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Open correct version of Powerpoint with VBA

    That's the idea, but with a vbs script you can inlude an msgbox asking which version and depending of that you can replace the 16 with 14 or 12 depending on the version you're using.

  20. #20
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    @cebalaw THANKS This method did indeed work
    Please Login or Register  to view this content.

  21. #21
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    Ok
    Post#20 method has kept me going
    - but is a workaround that will cause problems if I share the file with anybody else

    Anyone know a permanent fix to default VBA to open PowerPoint in 2016 version?
    - could this be a Registry issue?

  22. #22
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Open correct version of Powerpoint with VBA

    If you are concerned about different locations for PowerPoint application, could you not just test for the existence of the POWERPNT.EXE file in each directory (in order: 64-bit, then 32-bit) using DIR()?
    Please Login or Register  to view this content.

  23. #23
    Registered User
    Join Date
    10-15-2013
    Location
    Hawaii
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Open correct version of Powerpoint with VBA

    Back to the cytop message #6
    Would be interested myself to know what happens if you use Late Binding rather than Early Binding.
    Did you try to include the version you want (16)?
    Please Login or Register  to view this content.
    As far as the registry, what do you have under HKEY_CLASSES_ROOT\PowerPoint.Application\CurVer?

  24. #24
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    Did you try to include the version you want (16)?
    Yes - returns value 14 (which is 2010)

  25. #25
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    @cebelaw

    As far as the registry, what do you have under HKEY_CLASSES_ROOT\PowerPoint.Application\CurVer?
    This - which looks correct

    regEdit.jpg

  26. #26
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Open correct version of Powerpoint with VBA

    The CLSID is the same for every version of a given Office product, which is why passing a version number to CreateObject has no effect. Shell and then GetObject is the only method I have ever seen working. Do many of your users have multiple Office versions installed?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  27. #27
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open correct version of Powerpoint with VBA

    @xlnitwit - Thanks for that info - useful to know why that did not work

    Most other users are single version PC's and so this code would work for them
    Please Login or Register  to view this content.
    I use 2016 99% of the time and so would prefer this to be the VBA default (why should I be different? )
    - I am a simple soul and (although I do not understand what is going on "behind the scenes") hope there must be a "secret" value (somewhere) that can be changed
    - otherwise I have to live with this until I ditch 2010

    I only open 2010 when testing for backwards compatability
    - I would prefer to use the shell command for 2010

+ 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. Replies: 1
    Last Post: 06-09-2016, 12:05 PM
  2. Formulas not working in higher version, 2010 Version to 2013 version
    By thilag in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-19-2015, 09:09 PM
  3. Need to change VBA code from creating new PowerPoint to open an existing PowerPoint
    By bmchenry3 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2015, 12:14 AM
  4. Replies: 13
    Last Post: 01-11-2013, 04:46 PM
  5. Open PowerPoint program
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2009, 04:42 PM
  6. Open Powerpoint From Excel
    By Thommo7856 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-10-2008, 07:24 PM
  7. Open workbook macro- find correct month to open?
    By buzzharley in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-07-2006, 11:30 PM

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