|
-
Jul 5th, 2005, 04:15 AM
#1
Thread Starter
New Member
Problem sizing jpg in Excel using VBA
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
Last edited by Berend Botje; Jul 5th, 2005 at 06:32 AM.
-
Jul 5th, 2005, 09:56 PM
#2
Re: Problem sizing jpg in Excel using VBA
Post your "Call SizePicture" procedure code.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 6th, 2005, 03:01 AM
#3
Thread Starter
New Member
Re: Problem sizing jpg in Excel using VBA
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.
-
Jul 7th, 2005, 05:03 AM
#4
Thread Starter
New Member
Re: Problem sizing jpg in Excel using VBA
Solved my own problem 
Application.ScreenUpdating = False
Selection.ShapeRange.Height = 300
Application.ScreenUpdating = True
This works nicely.
Last edited by brad jones; Jul 7th, 2005 at 01:46 PM.
Reason: Advertising link removed by admin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|