PDA

View Full Version : [SOLVED] Placing Image - Different on another computer



ronjon65
12-25-2015, 12:35 PM
I am using the following code to place and image and it works just fine. However, when I tried it on another computer (with a different screen resolution), the size and position is way off with respect to the Excel sheet. Is this due to screen resolution? I am not sure what the root cause is and how to address it so that it works on any computer.


With ActiveWindow.Selection.ShapeRange
.ScaleWidth 0.5, msoFalse, msoScaleFromTopLeft
.ScaleHeight 0.5, msoFalse, msoScaleFromBottomRight
.Left = 460
.Top = 285
.PictureFormat.CropLeft = 121.5
.PictureFormat.CropBottom = 33
End With

P.S. The two computers were also 2003 and 2010 so that is another difference. But I am guessing it has more to do with screen resolution?

ronjon65
12-25-2015, 08:26 PM
It looks like 2003 and 2010 handled the above code in a different way. But this adjustment worked for both.


.ScaleWidth 0.5, True
.ScaleHeight 0.5, True