S
shelfish
Ok, I've searched this group for while and cannot find any solution to
this so here goes...
Please ignore syntax errors as this is strongly paraphrased from the
actual code. I'm just looking for a way to accomplish the
objective....
********************************************************************************
Dim PictureArray as variant = Array(chart1, chart2, chart3....)
Dim elementCount as int = PictureArray.Elements.count
Dim i
'COPY EXCEL CHARTS TO ARRAY AS PICTURES
For i = 1 To elementCount
With PictureArray(i)
.Select
[some code removed]
'COPY CHART AS PICTURE
PictureArray(i) = .CopyPicture(Appearance:=xlScreen,
Size:=xlScreen, Format:=xlPicture)
End With
Next
'START POWERPOINT
Set PPApp =
CreateObject("PowerPoint.Application")
PPApp.Visible = True
'NEW PRESENTATION
Set PPPres = PPApp.Presentations.Add
[more code removed]
'ADD NEW SLIDE TO THE END
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1,
ppLayoutTitleOnly)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
'PASTE PICTURE ARRAY ELEMENTS
For i = 1 To elementCount
With PPSlide
'PASTE IMAGE FROM ARRAY
On Error Resume Next
.Shapes.Paste (copyPasteArray(i))
.Shapes(i + 1).Select
End With
Next
*****************************************************************************************
This last part just pastes the last item copied to the clip board. So
the question is, how do I do all the copying and then all the
pasting.
Many thanks for any assistance offered.
S.
this so here goes...
Please ignore syntax errors as this is strongly paraphrased from the
actual code. I'm just looking for a way to accomplish the
objective....
********************************************************************************
Dim PictureArray as variant = Array(chart1, chart2, chart3....)
Dim elementCount as int = PictureArray.Elements.count
Dim i
'COPY EXCEL CHARTS TO ARRAY AS PICTURES
For i = 1 To elementCount
With PictureArray(i)
.Select
[some code removed]
'COPY CHART AS PICTURE
PictureArray(i) = .CopyPicture(Appearance:=xlScreen,
Size:=xlScreen, Format:=xlPicture)
End With
Next
'START POWERPOINT
Set PPApp =
CreateObject("PowerPoint.Application")
PPApp.Visible = True
'NEW PRESENTATION
Set PPPres = PPApp.Presentations.Add
[more code removed]
'ADD NEW SLIDE TO THE END
SlideCount = PPPres.Slides.Count
Set PPSlide = PPPres.Slides.Add(SlideCount + 1,
ppLayoutTitleOnly)
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
'PASTE PICTURE ARRAY ELEMENTS
For i = 1 To elementCount
With PPSlide
'PASTE IMAGE FROM ARRAY
On Error Resume Next
.Shapes.Paste (copyPasteArray(i))
.Shapes(i + 1).Select
End With
Next
*****************************************************************************************
This last part just pastes the last item copied to the clip board. So
the question is, how do I do all the copying and then all the
pasting.
Many thanks for any assistance offered.
S.