LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Excel 2007 and vb... ShapeRange.ScaleWidth problems

I have a vb macro that automatically places several jpg image on a worksheet
and rescales then to fit in boxes on the page. This macro has worked well
until we upgraded to 2007. Does anyone know if there has been a change in
syntax.

Here is the current vb code:

Sub InsertPICS(PicPath As String, PicWidth As Integer, PicTop As Integer,
PicLeft As Integer)

Dim ScaleRatio As Single

ActiveSheet.Pictures.Insert(PicPath).Select
Selection.Name = "3DPic"
ScaleRatio = PicWidth / Selection.Width

With Selection

.ShapeRange.ScaleWidth ScaleRatio, msoFalse, msoScaleFromTopLeft
.ShapeRange.ScaleHeight ScaleRatio, msoFalse, msoScaleFromTopLeft
.Left = PicLeft
.Top = PicTop


End With

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unselect shaperange object after drawing it with VBA? jedihe Excel Programming 2 July 28th 07 01:47 PM
Excel 2007 Problems [email protected] Excel Discussion (Misc queries) 1 March 5th 07 07:30 PM
Problem setting RGB Values with ShapeRange Bob Gibbons Excel Programming 4 August 26th 05 10:48 PM
Selection.ShapeRange.IncrementLeft error Anil Khemchandani Excel Programming 1 December 9th 03 09:29 PM
Selection.ShapeRange.IncrementLeft error Anil Khemchandani Excel Programming 0 December 9th 03 07:30 PM


All times are GMT +1. The time now is 05:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"