PDA

Click to See Complete Forum and Search --> : Problem sizing jpg in Excel using VBA


Berend Botje
Jul 5th, 2005, 04:15 AM
Hi all,

I am inserting a picture, then resizing it to be the correct size. After resizing, the user must choose one of the 4 options represented in the picture. Unfortunately, I have a problem here, because the sizing of the picture does not work if I run the program. The result is that the picture is too small for
the user to identify the 4 options. Why doesn't the sizing work?

I hope I explained the problem clearly enough. If you have questions, just post them.

Yours truly,

Berend Botje

P.s. Here is the code I use:


Sub RotatieSelectie(Unit As String)
Dim WSActive As Worksheet
Dim i As Integer

Set WSActive = ActiveSheet
PictureSheet.Activate
ActiveSheet.Pictures.Insert("C:\MyDir\Picture1.jpg").Select
Call SizePicture
Rotatiehoek = InputBox("Choose please. (1-4)", "Choose", "1", 400)
WSActive.Activate
Set WSActive = Nothing
End Sub

Sub SizePicture
Selection.ShapeRange.Height = 300
End Sub

RobDog888
Jul 5th, 2005, 09:56 PM
Post your "Call SizePicture" procedure code.

Berend Botje
Jul 6th, 2005, 03:01 AM
It is already there, at the end of my original post:

Sub SizePicture
Selection.ShapeRange.Height = 300
End Sub

Since I did not remove the Height-Width ratio lock, I only need to change the Height to size the picture.

Berend Botje
Jul 7th, 2005, 05:03 AM
Solved my own problem :)

Application.ScreenUpdating = False
Selection.ShapeRange.Height = 300
Application.ScreenUpdating = True

This works nicely. :thumb: