PPT opening from excel VBA

suresh ullanki

Board Regular
Joined
Apr 29, 2013
Messages
67
Hi,

I am trying to open power point using excel vba with the following code. it is not working. Can you please help

Sub PPT_Open()
File_name = Application.GetOpenFilename("Microsoft PowerPoint-Files (*.pptx*), *.pptx*")
If File_name = "False" Then
MsgBox "Stopping because you did not select a file"
Exit Sub
Else
PowerPointApp.Presentations.Open = File_name
End I
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Is PowerPointApp a reference to an instance of the PowerPoint application you've created/set somewhere else?
 
Upvote 0
yes it has already created. but file name will be changed every time. and folder name will be changed as well. hence i want to make prompt to open file.
 
Upvote 0
Try this.
Code:
PowerPointApp.Presentations.Open FileName:= File_name
 
Upvote 0
Where do you define "PowerPointApp"?

I wrote a routine to open powerpoint and convert Excel sheets to slides. Here is how I open the base file to add to it:

Code:
Dim ppApp As PowerPoint.Application
Dim ppPres As Presentation
Dim ppSlide As Slide
Dim ppContentSlide As Slide

Dim template As String

' Create instance of PowerPoint
Set ppApp = CreateObject("Powerpoint.Application")

' Open the template to create the new presentation
template = Workbooks(masterBook).Path & "\" & "Report_Template.pptx"
Set ppPres = ppApp.Presentations.Open(template, msoFalse)
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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