Excel to powerpoint
Hi all,
In PowerPoint I have created my own template with 3 slides. For slide 2
and 3 I have inserted chart.
Now I want to created a macro in Excel, such that the data I have
selected in excel should come in power point as chart.
I can able to invoke powerpoint form excel and for slide 2 the chart is
coimg correctly but for slide 3 its giving me an error "The index in
the specified collection is out of bonds". here IRange is the data
range slidecount is the slidenumber and objcount is the chart object
number. In my template the slide 2 chart had objcount as 2 and slide 3
has 4.
' excel chart data
Set rngData = Sheet3.Range(IRange)
' chart on slide
Set objPrs = objPPT.Presentations(1).Slides(slidecount)
' pointer to graph
Set objGraph = objPrs.Shapes(objcount).OLEFormat.Object.Applicati on
' Gettin error here
' pointer to graphs data sheet
Set objDataSheet = objGraph.Datasheet
Please help me on this. If you need further information I can provide
you the same.
Regards,
Srinivas
|