Microsoft Office Tutorials and References
In Depth Information
“The PowerPoint file “ & strFileName & vbCrLf & _
“does not exist in the folder path” & vbCrLf & _
strFilePath & “.”, _
vbInformation, “No such animal.”
Set ppApp = CreateObject(“PowerPoint.Application”)
‘Make the PowerPoint application visible.
ppApp.Visible = msoTrue
‘Open the PowerPoint presentation you want to run.
Set ppPres = ppApp.Presentations.Open(strFilePath & strFileName)
‘Establish the amount of time each slide should be shown,
‘which in this example is 3 seconds.
.advanceontime = True
.advancetime = 3
‘Run the PowerPoint presentation.
‘When the presentation is completed, have VBA regard it as saved
‘so you are not prompted to save the presentation when you close it.
ppPres.Saved = True
‘Quit Powerpoint (optional)
‘Release memory taken from the Object variables.
Set ppPres = Nothing
Set ppApp = Nothing
In this lesson, you copy an embedded chart to an empty slide in an open PowerPoint presentation.
With a PowerPoint presentation open, you copy an embedded chart from your Excel workbook
and paste its picture image into an empty slide. To get the sample database files you can download
From your workbook, press Alt+F11 to go to the Visual Basic Editor.
From the menu at the top of the VBE, click Insert ➪ Module.