Locking the aspect ratio of an image embedded in a comment

ironhead

New Member
Joined
Jun 10, 2005
Messages
2
Hi there,

I would like to lock the aspect ratio of an image that is embedded in a shape when inserting images from VBA. From the GUI this is simple:
Format Comment/Colors and Lines/Fill Effects/Picture/ then there is a nice checkbox. Despite my best efforts, I haven't been able to find how to trigger this switch in VBA.

There is another aspect ratio that deals with the comment itself, not the embedded picture. This aspect ratio is easy to change - from the GUI it is: Format Comment/Size/LockAspectRatio.
In VBA, this checkbox is under the Comment.Shape.LockAspectRatio property.

Any ideas on where the picture is stored in the object hierarchy and how to lock its aspect?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I would like to lock the aspect ratio of an image that is embedded in a shape when inserting images from VBA. From the GUI this is simple:
Format Comment/Colors and Lines/Fill Effects/Picture/ then there is a nice checkbox.

Try to lock aspect ratio from the GUI while recording a Macro. Then stop the macro and see what has been recorded....
 
Upvote 0
I tried that before posting to this forum. Does anyone know where an image attached to a fill background is stored in the object? It isn't part of the sheet.pictrures collection. Is it part of the fill object?
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top