I have a code which extract data from Excel and insert it into multiple slides in the PowerPoint.
Dim I As Integer
Dim oXL As Object 'Excel.Aplication
Dim OWB As Object 'Excel.workbook
Dim oSId As Slide
Dim A As Integer
Dim B As Integer
Set oXL = CreateObject(“Excel.Application”)
Set OWB = oXL.Workbooks.Open(FileName:="FileName.xlsx")
A = InputBox(“Page From")
B = InputBox(“Page To")
For I = A To B
oSId.Shapes(“Title l").TextFrame.TextRange.Text = OWB.Sheets(“Sheet1").Range(“A" &
CStr(l)). Value
oSId.Shapes(“Subtitle 2").TextFrame.TextRange.Text = OWB.Sheets(“Sheet1").Range(“B" &
CStr(l)). Value
oSId.Shapes(“Text Placeholder 3").TextFrame.TextRange.Text = OWB.Sheets(“Sheet1").Range(“C" & CStr(l)).Value
oSId.Shapes(“Text Placeholder 4").TextFrame.TextRange.Text = OWB.Sheets(“Sheet1").Range(“D" & CStr(l)).Value
Next
OWB.CIose
oXL.Quit
Set OWB = Nothing
Set oXL = Nothing
End Sub
I want the code to insert picture automatically into PowerPoint based on the cell value of Excel.
For example:
In the PowerPoint Slide, Range A1 is "Apple", Range A2 is "Orange", Range A3 is "Pear"
I have a Folder D:\Users\User\Desktop\Picture\
containing picture of "Apple.jpg", "Orange.jpg", "Pear.jpg".
The code will insert the picture in folder to the slides.
Appreciate your help and guidance! Thank you.