I am using the Workbooks->Open method in read only mode and then converts all the chart objects in the excel file into png images. The problem is that it takes a while for excel to produce charts correctly and the script executes as soon as the file is opened, because of this the images are not the same as the actual charts and the curves are not proper.
What is the way to insert a delay in the script so that the charts are produced correctly and then they are exported into images.
Here is my code:
my $Book = $Excel->Workbooks->Open( $filename, 0, 1 );
foreach my $ChartObj (in $Book->Charts)
{
my $chartName = $ChartObj->Name;
my $savename = $filepath."\\$chartName.$filter";
$ChartObj->Export({
FileName => $savename,
FilterName => $filter,
Interactive => 0});
}
$Book->Close;
I want to insert a delay between open method and for loop.