Microsoft Office Tutorials and References
In Depth Information
Running a PowerPoint Presentation from Excel
.Characters(Start:=1, Length:=0).Select
.Text = “This is “ & ch.Name
With .Font
.Name = “Arial”
.Size = 12
.Bold = msoTrue
End With
End With
End With
‘Continue the loop until all chart sheets have been copied.
Next ch
‘End the macro by activating the first slide.
ppApp.ActiveWindow.View.GotoSlide 1
‘Save your new file.
pptPres.SaveAs Filename:=ThisWorkbook.Path & “\ChartSheetTest.pptx”
‘Relase system memory reserved for the Object variables.
Set ppApp = Nothing
Set pptSlide = Nothing
Set pptPres = Nothing
Set ppApp = Nothing
End Sub
running A poWErpoinT prEsEnTATion froM ExcEl
Running a PowerPoint presentation from Excel provides a dynamic effect to your Excel project. Unlike
Word, Outlook, or Access, just opening a presentation file in PowerPoint is not enough if you want
to show what that file contains. You can cycle through the slides with the slideshowsettings.Run
statement. Notice the With structure that demonstrates a method of setting the amount of time (three
seconds of the advancetime property in this example) that each slide will be shown, without affecting
the user’s local PowerPoint slide transition settings.
Sub PowerPointSlideshow()
‘Declare Object variables for the PowerPoint application
‘and for the PowerPoint presentation file.
Dim ppApp As Object, ppPres As Object
‘Declare String variables for folder path and name of file.
Dim strFilePath As String, strFileName As String
‘Define the String variables with the directory path and name.
strFilePath = “C:\Your\File\Path\”
strFileName = “PowerPointExample1.pptx”
‘Verify if the path and filename really exist.
‘If not, exit the macro and advise the user.
If Dir(strFilePath & strFileName) = “” Then
MsgBox _
Search JabSto ::




Custom Search