Consulting

Results 1 to 2 of 2

Thread: Placing Image - Different on another computer

  1. #1

    Placing Image - Different on another computer

    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?

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •