When you post is several forums please say so! It stops people working on problems solved elsewhere.
You need really to give more detail (including how much you know!)
Assuming the folder is at "C:\Pics\" (change the code to suit) AND the list of images starts at "A1" then "A2" etc
Try this in PowerPoint (You will need to set a reference to Excel) Excel file must be open and active
Sub Pic_Choose()
Dim i As Integer
Dim XLApp As Excel.Application
Dim pptSlide As Slide
Dim pptShape As Shape
Dim strFolder As String
strFolder = "C:\Pics\" ' change to suit
Set XLApp = GetObject(Class:="Excel.application")
Do Until IsEmpty(XLApp.Range("A1").Offset(i, 0))
Set pptSlide = ActivePresentation.Slides.Add(ActivePresentation.S lides.Count + 1, ppLayoutBlank)
Set pptShape = pptSlide.Shapes.AddPicture(FileName:=strFolder & XLApp.Range("A1").Offset(i, 0), _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=10, Top:=10, Width:=-1, Height:=-1) '-1 =True (original size)
'to change size
pptShape.Width = 3 * 72 '=3 inches (72 points= 1 inch)
i = i + 1
Loop
End Sub
|