in reply to Re: Adding Slide to Powerpoint
in thread Adding Slide to Powerpoint

Thanks for your suggestions, but I am still having problems. I see what you were trying to accomplish, so it has given me a better starting point. I updated the code, but it still fails with the same error. Do you know if I need to switch between active presentations in order to copy, paste, etc...
sub addMyFile{ my $file = shift; my $fullpath = "$edmdir\\$file"; my $addpres = $ppt->Presentations->Open( $fullpath ) or die "Can't + open PowerPoint file '$fullpath': $!\n"; my $j = 1; my $slide; my $newslide; while ($j < 10){ # this is hard coded while i figure out the bug +s, but it will be length of the file $newslide = $pres -> Slides->Add($slideIndex,$addpres->Slides( +$j)->Layout); $newslide = $addpres->Slides($j); $j++; $slideIndex++; } };