Hi All,
I have to produce a large power point presentation for our Xmas party with all of our compliments for the year. I have over 1200 entries on an excel spreadsheet and have been trying to write/research the code to convert this in to a powerpoint presentation but I'm struggling so far!
My assumption based on what I've found is I would need to start along these lines:
Sub ExcelToExistingPowerPoint()
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
' Reference instance of PowerPoint
On Error Resume Next
' Check whether PowerPoint is running
Set PPApp = GetObject(, "PowerPoint.Application")
If PPApp Is Nothing Then
' PowerPoint is not running, create new instance
Set PPApp = CreateObject("PowerPoint.Application")
' For automation to work, PowerPoint must be visible
PPApp.Visible = True
End If
On Error GoTo 0
' Reference presentation and slide
On Error Resume Next
If PPApp.Windows.Count > 0 Then
' There is at least one presentation
' Use existing presentation
Set PPPres = PPApp.ActivePresentation
' Use active slide
Set PPSlide = PPPres.Slides _
(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
Else
' There are no presentations
' Create new presentation
Set PPPres = PPApp.Presentations.Add
' Add first slide
Set PPSlide = PPPres.Slides.Add(1, ppLayoutBlank)
End If
On Error GoTo 0
' Some PowerPoint actions work best in normal slide view
PPApp.ActiveWindow.ViewType = ppViewSlide
From this stage I need to duplicate the slide and update various items from my excel file including the person's name, ID number, the compliment text and the person's picture.
My excel sheet has all the relevant data I should need including the path and file names for the photos I just don't know how to process the changes and looping?
Any help would be greatly appreciated!!
(If there's a way I can attach or upload templates of my ppt or spreadsheet I'd be more than happy to.)
I have to produce a large power point presentation for our Xmas party with all of our compliments for the year. I have over 1200 entries on an excel spreadsheet and have been trying to write/research the code to convert this in to a powerpoint presentation but I'm struggling so far!
My assumption based on what I've found is I would need to start along these lines:
Sub ExcelToExistingPowerPoint()
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
' Reference instance of PowerPoint
On Error Resume Next
' Check whether PowerPoint is running
Set PPApp = GetObject(, "PowerPoint.Application")
If PPApp Is Nothing Then
' PowerPoint is not running, create new instance
Set PPApp = CreateObject("PowerPoint.Application")
' For automation to work, PowerPoint must be visible
PPApp.Visible = True
End If
On Error GoTo 0
' Reference presentation and slide
On Error Resume Next
If PPApp.Windows.Count > 0 Then
' There is at least one presentation
' Use existing presentation
Set PPPres = PPApp.ActivePresentation
' Use active slide
Set PPSlide = PPPres.Slides _
(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
Else
' There are no presentations
' Create new presentation
Set PPPres = PPApp.Presentations.Add
' Add first slide
Set PPSlide = PPPres.Slides.Add(1, ppLayoutBlank)
End If
On Error GoTo 0
' Some PowerPoint actions work best in normal slide view
PPApp.ActiveWindow.ViewType = ppViewSlide
From this stage I need to duplicate the slide and update various items from my excel file including the person's name, ID number, the compliment text and the person's picture.
My excel sheet has all the relevant data I should need including the path and file names for the photos I just don't know how to process the changes and looping?
Any help would be greatly appreciated!!
(If there's a way I can attach or upload templates of my ppt or spreadsheet I'd be more than happy to.)