Solved

Autolock aspect ratio?

Posted on 2011-02-15
4
1,624 Views
Last Modified: 2012-05-11
Hey experts,

When I insert images in excel, the aspect ratio is not locked by default. It was, but it aren't anymore.

How do I change the default setting, so that whenever I insert a picture or the like, the aspect ratio is locked by default?

Excel 2007 on Windows.

Regards, Raahaugen
0
Comment
Question by:Raahaugen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 42

Expert Comment

by:dlmille
ID: 34902892
Right click on your picture and select Size And Properties.  There's a checkbox for locking aspect ratio.

See picture:

Enjoy!
lock picture tipDave
0
 

Author Comment

by:Raahaugen
ID: 34904075
Hey dimille,

The problem is not to turn the lock on and off. The problem is to make it turned on as the default setting when inserting images in excel?

It used to be the default setting, but somehow it was turned off.

Maybe a solution is to run a macro every time a image is inserted?
0
 
LVL 42

Accepted Solution

by:
dlmille earned 500 total points
ID: 34912246
Selection.ShapeRange.LockAspectRatio = msoTrue

is the VBA command line if the picture is selected.

My settings have LockAspectRatio as True all the time, and I'm searching for defaults.

In leiu of that, here's a macro as one solution.  It locks aspect ratio on all shapes in the active sheet


Sub AutoLockAllPictures()
Dim myShape As Shape

    For Each myShape In ActiveSheet.Shapes
        myShape.LockAspectRatio = msoTrue
    Next myShape
    
End Sub

Open in new window

0
 

Author Closing Comment

by:Raahaugen
ID: 35107097
Thanks for your assistance. Sorry for being late closing the q.

Regards
Raahaugen
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question