ZJ.Mike.2009 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, monks,
I'm trying to scale the inserted image in an Excel file but in vain. Could someone enlighten me? Thanks in advance!
Following is the code I've tried:

use strict; use warnings; use OLE; use Win32::OLE::Const "Microsoft Excel"; my $excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $excel->{Visible} = 1; my $workbook = $excel->Workbooks->Open("D:/test.xls"); my $sheet = $workbook->Worksheets("Sheet 1"); my $image = $sheet->Pictures->Insert("D:/test.jpg"); #Inserts image s +ucessfully #The following code fails $image->{ShapeRange}->ScaleWidth("0.06, 0,2"); #Tries to scale with to + 6% but fails $image->{ShapeRange}->ScaleHeight("0.06, 0,2"); #Tries to scale height + to 6% but fails #Saves and quits $workbook->Save; $workbook->Close;

Solution found!

Just fixed the problem on my own:
The problem was with the ScaleWidth paramters AND the select property!
my $shape = $image->{ShapeRange}; $shape->Select; $shape->ScaleWidth(0.06,1); $shape->ScaleHeight(0.06,1);