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 sucessfully #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;