Hello all,
I am inserting a report into PowerPoint automatically with code. It is working well, but I'm only half way there. Is there any way to move to the next page in a Snapshot with code?
i.e., Page one of the Snapshot is on slide one of the PowerPoint. Page two of the Snapshot is on slide two of the PowerPoint... and so on?
Here is the code I have so far that works well for inserting the Snapshot into my PowerPoint template. Any advice is appreciated. Thank you.
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
' Open up an instance of Powerpoint and the existing template.
Set ppObj = CreateObject("PowerPoint.Application")
ppObj.Visible = True
Set ppPres = ppObj.Presentations.Open("C:\PowerPointTemplate.ppt")
ppObj.ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120, Top:=110, Width:=480, Height:=320, FileName:="C:\MyReport.snp", Link:=False).Select
ppObj.ActiveWindow.Selection.Unselect
Exit Sub
Err_Command3_Click:
MsgBox Err.Number & " " & Err.Description
End Sub
I am inserting a report into PowerPoint automatically with code. It is working well, but I'm only half way there. Is there any way to move to the next page in a Snapshot with code?
i.e., Page one of the Snapshot is on slide one of the PowerPoint. Page two of the Snapshot is on slide two of the PowerPoint... and so on?
Here is the code I have so far that works well for inserting the Snapshot into my PowerPoint template. Any advice is appreciated. Thank you.
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
' Open up an instance of Powerpoint and the existing template.
Set ppObj = CreateObject("PowerPoint.Application")
ppObj.Visible = True
Set ppPres = ppObj.Presentations.Open("C:\PowerPointTemplate.ppt")
ppObj.ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120, Top:=110, Width:=480, Height:=320, FileName:="C:\MyReport.snp", Link:=False).Select
ppObj.ActiveWindow.Selection.Unselect
Exit Sub
Err_Command3_Click:
MsgBox Err.Number & " " & Err.Description
End Sub