merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

Yesterday I posted a question asking how separately I can set the height and width of an image in Excel. This means that the aspect ratio of the image will change. I have also been looking on the net.
I believe that I have to set a LockAspectRatio property to false.
On the following site I found someone with a similar problem using VBA. (Incidentally they too seemed unable to record ‘actions’ associated with pictures.)
http://social.answers.microsoft.com/Forums/en-US/officeprog/thread/92d3664c-b30f-43f8-bf4b-b53c1c621a53
The following was given as a suggested VBA code
or this one if you want to scale the height and width independently of + each other Sub ScalePicture2(pic As Shape, hscale As Double, vscale As Double) pic.LockAspectRatio = False pic.ScaleHeight factor:=hscale, RelativeToOriginalSize:=msoTrue pic.ScaleWidth factor:=vscale, RelativeToOriginalSize:=msoTrue End Sub Sub test2() ScalePicture2 pic:=ActiveSheet.Shapes("Picture 1"), hscale:=1.4, vs +cale:=1.8 'just an example End Sub
However, there still were problems but towards the end there is the following comment and code

It turns out that the ShapeRange commands work on drawing objects (which includes pictures in the drawing layer). These didn't work on my pictures as they are in thetext layer as 'inline shapes' - what you get if you do a Insert/Picture.
However, most of the same commands exist for the InlineShape command, +so this macro works! Sub scale37() Selection.InlineShapes(1).LockAspectRatio = True Selection.InlineShapes(1).ScaleHeight = 37 End Sub
Therefore it looks as though I need to:
1. Load in my image;
2. Convert the image to an InlineShapes – say $pic_inlineimage
3. Then use something like
$pic_inlineimage ->{LockAspectRatio} = “False”;
The Perl to load the image is next
use strict ; use OLE; use Win32::OLE::Const "Microsoft Excel"; my ($excel, $workbook, $sheet, $j, $row, $range, $cell_str, $content, +$contentb, , $contentc, $width_found, $id, $test_cell_idg ); my ($worktable_name, $jwk, $jr, $sheets_total, $new_wk); my ($cell_tg, $v_pos, $h_pos, $pic_cur, $image_file_full, $cell_id, $c +ur_width, $cur_height, $aspect_ratio, $res, $pic2_cur, $asp_pic_lock) +; #___ DEFINE EXCEL $excel = CreateObject OLE "Excel.Application"; #___ MAKE EXCEL VISIBLE $excel -> {Visible} = 1; #___ ADD NEW WORKBOOK $workbook = $excel -> Workbooks -> Add; $sheet = $workbook -> Worksheets("Sheet1"); $sheet -> Activate; $image_file_full = "directory and path to image"; $cell_id = "B3"; $cell_tg = $sheet->Range($cell_id); $v_pos = $cell_tg->Top; $h_pos = $cell_tg->Left; # insert picture with top left hand corner at cell_id $pic_cur = $sheet->Pictures->Insert($image_file_full);
Can any Monk tell me exactly what I should do?