arundurai has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I have to create a column chart with rwo series in a ppt, I have the data for the chart in separate arrays. Please help me withthe command to add a chart in a ppt. I have give the code that i used to create a ppt and add a slide in it.
my $PptApp = Win32::OLE->GetActiveObject('PowerPoint.Application')|| +Win32::OLE->new('PowerPoint.Application', 'Quit'); $PptApp->{Visible} = 1; #my $Presentation = $PptApp->Presentations->Add(); my $Presentation = $PptApp->Presentations->Open({FileName=>'C:\Users\n +1013784\Desktop\New folder\weeklytemplate1.pptx',ReadOnly=>0}); my $value = 0; my $AfterSlide = "Agenda"; my $SlideIndex = 1; my $slides = Win32::OLE::Enum->new( $Presentation->Slides ); while ( my $slide = $slides->Next ) { print "Slide_Name : " . $slide->Name . "\n"; my $shapes = Win32::OLE::Enum->new( $slide->Shapes ); SHAPE: while ( my $shape = $shapes->Next ) { my $type = $shape->PlaceholderFormat->Type; if ( $type == ppPlaceholderTitle or $type == ppPlaceholderCent +erTitle or $type == ppPlaceholderVerticalTitle) { print "Title : |" . $shape->TextFrame->TextRange->text . " +|\n"; if($shape->TextFrame->TextRange->text eq $AfterSlide){ $value = $SlideIndex + 1; print "Put it on $SlideIndex\n"; } $SlideIndex++; last SHAPE; } } print "\n"; } my $Slide = $Presentation->Slides->Add({Index=>$value , Layout=>ppLayo +utText}); $Slide->{Name} = "111 + $dev"; my $Title=$Slide->Shapes->{Title}; $Title->TextFrame->TextRange->{Text} ="Weekly Metrics - Closed Tick +ets";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Create a chart in PPT
by hdb (Monsignor) on Mar 21, 2013 at 09:00 UTC | |
by arundurai (Initiate) on Mar 21, 2013 at 09:06 UTC | |
by marto (Cardinal) on Mar 21, 2013 at 09:12 UTC | |
by hdb (Monsignor) on Mar 21, 2013 at 10:10 UTC | |
by hdb (Monsignor) on Mar 21, 2013 at 10:15 UTC | |
by arundurai (Initiate) on Mar 26, 2013 at 11:00 UTC | |
|
Re: Create a chart in PPT
by Corion (Patriarch) on Mar 21, 2013 at 10:12 UTC | |
by hdb (Monsignor) on Mar 21, 2013 at 10:22 UTC | |
by Corion (Patriarch) on Mar 21, 2013 at 10:27 UTC | |
by hdb (Monsignor) on Mar 21, 2013 at 10:35 UTC | |
by marto (Cardinal) on Mar 21, 2013 at 10:41 UTC | |
by ambrus (Abbot) on Mar 26, 2013 at 11:47 UTC | |
by hdb (Monsignor) on Mar 26, 2013 at 12:11 UTC | |
by ambrus (Abbot) on Mar 26, 2013 at 16:56 UTC | |
|
Re: Create a chart in PPT
by marto (Cardinal) on Mar 21, 2013 at 09:10 UTC |