How do I specify the powerpoint.application version in VBA?

Johnny C

Well-known Member
Joined
Nov 7, 2006
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
I've got some code chucking reports from XL2007 into a powerpoint presentation.

The PC default powerpoint is Powerpoint 97, but there's also powerpoint 2007. I can't change the default to the later one because it's on XP clamped down, I can't access useful things like changing default programs for file-types.

So, when I do

Code:
Dim PPApp As PowerPoint.Application

If PPApp Is Nothing Then Set PPApp = New PowerPoint.Application

it opens Powerpoint97.

I know you can specify the version to open, but VBA Help just says you can, it doesn't mention anything useful like how to do that.

How do I specify the PP version?

TIA
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I think it's something like this:

Code:
CreateObject("PowerPoint.Application.version")

where version is the version number of the application.

For example if you have PP 2000 and 2003 on one computer, this should start the '03 version:

Code:
CreateObject("PowerPoint.Application.11")
 
Upvote 0
Hi there,

I have both 2003 and 2007 installed.

Despite the fact I specify the version "12" it keeps launching 2003 PPT version.

Am I issing something?

Can one use the shell commad for other office applications too?

Tks.
 
Upvote 0
Try:
Code:
    If PPApp Is Nothing Then Set PPApp = CreateObject("PowerPoint.Application.12")
    PPApp.Presentations.Add
    PPApp.Visible = True

That worked for me.
Something else to try (if you can) go into Control Panel, Software options and look for 'default programs' and see if PP is on there. You may be able to fix it that way. I can't from here at work as I'm on XP with Control Panel mostly disabled.
 
Upvote 0
Hi there Johnny C,

Tks for the comment.

I was already using the code you wrote above.

Actually almost the same since I was was not performing the test condition and using the set statement straight ahead.

Anyways, both codes gives the same "wrong" result (i.e, the desired PPT version is not launched).

Funny thing though, I was just playing around those macros at the office (where I have 2003, 2007, and 2010 installed) and, to my surprise, my macro only opens the the most recent version of PPT, exactly the opposite from my home computer, no matter which version I specify in the macro (in addition, it also doesn´t matter from which version from Excel I execute the macro).

Another bit of information is that at home, if I use the following statement
"Application.ActivateMicrosoftApp xlMicrosoftPowerPoint", the version I get is 2007 (and not 2003).

Any further thoughts? Tks.
 
Upvote 0
it might be that Windows maintains some sort of order in which the versions were installed, or else something in the registry indicates the most recently installed version and the VBA is interpreted by windows to open the most recently installed. In which order did you install them at home?

I'll try the code you've got here at work and see which version it opens.
 
Upvote 0
As far as Excel goes, you cannot control the version launched unless you use Shell - I don't know if PowerPoint works the same.
 
Upvote 0
Code:
Shell "C:\path to version of Excel you want\excel.exe"
for example. However, this will not return a reference to any Excel objects, so you need API calls for that.
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top