Picture Orientation

J

Jess

I have an excel sheet that inserts pictures store in folder. Just before
inserting the picture I need to know wether the picture orientation is
landscape or portrait. How can I know that without inserting the actual
picture?

This is the code I use; it determines the pic orientation AFTER inserting
the picture. I would like to avoid inserting the picture; I just need the
orientation.

Set pic = xlApp.ActiveSheet.Pictures.Insert(PictureName)

If pic.ShapeRange.height <= pic.ShapeRange.width Then
PicOrientation = "Landscape"
Else
PicOrientation = "Portrait"
End If

How can I accomplish this?
 
H

Helmut Meukel

Dim mypic as StdPicture
set mypic = LoadPicture(PictureName)
If mypic.Height <= mypic.Width then

You still have to load the picture into the object mypic.

HTH.

Helmut.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top