Lock Aspect Ratio of Inserted Comment Picture - Excel 2011 for Mac

gwlip

New Member
Joined
Apr 18, 2005
Messages
12
Hi all,

I have a script that adds a picture and resizes it. How do I lock the aspect ratio of the image attached?
My script is below ... I thought it should work correctly with the last line? Any help is appreciated! Thanks!

ActiveCell.AddComment.Text ""
ActiveCell.Comment.Shape.Fill.UserPicture MyFiles
ActiveCell.Comment.Shape.Height = 300
ActiveCell.Comment.Shape.Width = 300
ActiveCell.Comment.Shape.LockAspectRatio = msoTrue
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Using the macro recorder I found that this line does work:

Code:
Selection.ShapeRange.LockAspectRatio = msoTrue
 
Upvote 0
I tested it before posting. Perhaps there's some other syntax error in your code.
 
Upvote 0
I think the issue for me here is that I am trying to lock the aspect ratio of the image used in the comment box (so that the uploaded image's aspect ratio is correct compared to the original image).
I believe locking aspect ratio only works for the comment box but this does not affect the image that i have uploaded?
I do not think there is a way to do this via Excel or VBA correct me if I am wrong?
 
Upvote 0
I do not know of any way to format the properties of an image that is placed within a comment box.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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