Hi,
i've been using this code to export a certain range from Excel to PPT (major thx to Haluk for helping me out with it):
the presentation changes daily, so right now its exporting the range to slide 2, and deletes the old one which became now slide 3. how can i write the code so i can copy several ranges to different slides? for example range A1:B7 will be copied to slide 3, and range F5:H12 copied to slide 4?
thx
i've been using this code to export a certain range from Excel to PPT (major thx to Haluk for helping me out with it):
Code:
Sub SendRangeDelete()
Dim MyMyRng As Range
Dim appPowerPoint As Object
Dim filePowerPoint As Object
Dim mySlide As Object
Dim strPPTfile As String
Set MyRng = ActiveSheet.Range("E5:I9")
strPPTfile = "C:\Had\Duties.pptx"
Set appPowerPoint = CreateObject(class:="PowerPoint.Application")
Set filePowerPoint = appPowerPoint.Presentations.Open(strPPTfile)
Set mySlide = filePowerPoint.Slides.Add(2, 11)
filePowerPoint.Slides(3).Delete
MyRng.Copy
mySlide.Shapes.PasteSpecial DataType:=10
appPowerPoint.Presentations(strPPTfile).Save
appPowerPoint.Presentations(strPPTfile).Close
appPowerPoint.Quit
Application.CutCopyMode = False
End Sub
the presentation changes daily, so right now its exporting the range to slide 2, and deletes the old one which became now slide 3. how can i write the code so i can copy several ranges to different slides? for example range A1:B7 will be copied to slide 3, and range F5:H12 copied to slide 4?
thx