ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Picture Orientation (https://www.excelbanter.com/excel-programming/442209-picture-orientation.html)

Jess

Picture Orientation
 
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?


Helmut Meukel

Picture Orientation
 
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.


"Jess" schrieb im Newsbeitrag
...
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?





All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com