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.
> 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
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).