$clip = Win32::Clipboard();
sub select_and_paste_into_ppt()
{
$clip->Empty();
$sheet_to_rename->UsedRange->Select;
$sheet_to_rename->UsedRange->Copy;
save_image();
paste_image_to_ppt();
$Title->TextFrame->TextRange->{Text} = $sheet_to_rename->{Name}
+;
$image_count++;
add_new_slide();
$clip->Empty();
}
sub save_image()
{
$image = Win32::Clipboard::GetBitmap() or die "\nNo Image Captured
+ \n";
open BITMAP, ">$path.\\Images\\$image_count.jpg";
binmode BITMAP;
print BITMAP $image;
close BITMAP;
}
Hi Everyone,
Above is my perl code to select the cells in excel's active sheet and put the image file in a particular folder. This routine works fine. But if this runs continously for more than 80+ times I get an error "\nNo Image Captured \n" and the program dies(I can remove the die command and let the program continue without any problem but it will skip that particular image). Restarting the computer solves this problem. I have to run this script on the machines that I can not restart. I guess I am opening too many clipboards somehow? Can anyone point me to the right direction?