Microsoft Office Tutorials and References
In Depth Information
Try It
“The PowerPoint file “ & strFileName & vbCrLf & _
“does not exist in the folder path” & vbCrLf & _
strFilePath & “.”, _
vbInformation, “No such animal.”
Exit Sub
End If
‘Open PowerPoint
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.
With ppPres.slides.Range.slideshowtransition
.advanceontime = True
.advancetime = 3
End With
‘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
End Sub
Try iT
In this lesson, you copy an embedded chart to an empty slide in an open PowerPoint presentation.
lesson requirements
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
Lesson 30 from the book’s website at .
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.
Search JabSto ::

Custom Search