###########################################################
#
# sub create_ppt_presentation
#
# create and return a new blank presentation
#
# $title is title for the presentation
#
###########################################################
sub create_ppt_presentation
{
my ($title) = @_;
my ($PptApp, $Presentation, $Slide);
trace("create_ppt_presentation: getting powerpoint.application object\n");
$PptApp = Win32::OLE-> GetActiveObject('PowerPoint.Application')
|| Win32::OLE-> new('PowerPoint.Application', 'Quit');
$PptApp-> {Visible} = IS_PPT_VISIBLE;
$Presentation = $PptApp-> Presentations->Add();
return ($PptApp, $Presentation);
}
####
$Slide = $Presentation-> Slides->Add({Index => $position, Layout => ppLayoutBlank});
$Slide->{Name} = "test";
$graph_shape = $Slide->Shapes->AddOleObject({
Left => 10,
Top => 40,
Height => 450,
Width => 650,
ClassName => "MSGraph.Chart",
Link => 0});
$graph = $graph_shape->OLEFormat->{Object}; # ms graph chart object
# i can now work with $graph
####
$datasheet = $graph->Application->{DataSheet};
$datasheet->Cells->ClearContents();
# i can now feed the datasheet with some datas
# ...
# after the settings of the datasheet's cells, free graph and datasheet
undef $datasheet;
undef $graph;
####
# $Presentaion is the powerpoint presentation object
$Presentation->SaveAs("c:/test.ppt");