Original Picture Size in VBA?

H

Howard Knight

Hello,

In Excel, you are able to reset a picture to its "Original size". I'm
wondering if it possible to get the original size in VBA. Consider this:

In Excel, select an image in one of the cells. Right click, and select
"Format Picture". In the Format Picture dialog, click the "Size" tab. At the
bottom of the tab, it shows the "Original size". That is the size I would
like to access via VBA.

On a related note, if you press the "Reset" button while recording a macro,
the code in the macro just sets the picture to a hard coded width and
height. As if that is ever useful.

BTW, I'm using an older version of Excel (Office 2000). However, I can't
find a way to get these values even in newer versions.

Howard
 
I

isabelle

hi Howard,


'expression.ScaleHeight(Factor, RelativeToOriginalSize)
'Factor 1 = 100%

With ActiveSheet.Shapes(1)
.ScaleHeight 1, msoTrue
.ScaleWidth 1, msoTrue
End With
 
H

Howard Knight

isabelle said:
'expression.ScaleHeight(Factor, RelativeToOriginalSize)
'Factor 1 = 100%

With ActiveSheet.Shapes(1)
.ScaleHeight 1, msoTrue
.ScaleWidth 1, msoTrue
End With

That's the ticket. Thanks!

Howard
 

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