Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PowerPoint chart, change data

6 views
Skip to first unread message

Sister Ray

unread,
Oct 3, 2008, 2:27:26 PM10/3/08
to
I'm trying to Create a Power Point Presentation using MFC and C++.
This presentation will have some Charts, I'm trying to find out how to
change the data of the chart after having created it.

So Far I've got this code:

_Application pptApplication;
if ( !pptApplication.CreateDispatch( "Powerpoint.Application",
NULL ) ) return;
pptApplication.SetVisible(1);
Presentations pptPresentations = pptApplication.GetPresentations();
_Presentation presentation = pptPresentations.Add(100);
Slides slides(presentation.GetSlides());
_variant_t vlayout = (short)1;
_Master master = presentation.GetSlideMaster();
CustomLayouts layouts = master.GetCustomLayouts();

CustomLayout layout = layouts.Item(vlayout);

_Slide slide = slides.AddSlide(1, layout);
Shapes shapes = slide.GetShapes();
Shape chart = shapes.AddChart(5,5,5,100,100);

The question is how do i get table containing the data for the chart?

Note; I'm using office 2007.

S simple

unread,
Dec 8, 2010, 8:22:58 PM12/8/10
to
I want known too, no one answer ?


> Submitted via EggHeadCafe
> Microsoft LINQ Query Samples For Beginners
> http://www.eggheadcafe.com/training-topic-area/LINQ-Standard-Query-Operators/33/LINQ-Standard-Query-Operators.aspx

Carlos JP

unread,
Dec 9, 2010, 5:34:06 AM12/9/10
to
On 9 Dez, 01:22, S simple <yuejun1...@126.com> wrote:
> I want known too, no one answer ?

It's been a while since I worked on that but from what I can remember,
I don't have the code for it, in office 2007 when you add a chart to a
power point slide behind the scenes a Excel instance is launched, and
it's in that instance that you can find the data for the chart. I
think, not absolutely certain of that, if you ask the chart for its
application, it will return the excel instance, and there you can play
around with the data.

Hope I helped,
cjp (ex-SisterRay).

0 new messages