+ Reply to Thread
Results 1 to 2 of 2

Picture Import Questions - Size and Placement

  1. #1
    Shatin
    Guest

    Picture Import Questions - Size and Placement

    I use following lines to import two pictures into a worksheet:

    With ActiveSheet.Pictures
    .Insert ("http://www.abc.com/picture1.jpg")
    .Insert ("http://www.abc.com/picture2.jpg")
    End With

    Both pictures are too big; also the placement of the pictures is rather
    haphazard.

    Would appreciate it if someone could me how to:

    - place picture1 somewhere near to cell A1 and picture2 near to cell A20.
    - resize height of picture1 to 3 inches
    - resize width of picture2 to 4 inches

    TIA.



  2. #2
    Dave Peterson
    Guest

    Re: Picture Import Questions - Size and Placement

    This kind of thing works ok when I import a picture from my harddrive--I've
    never used it for web sites:

    Option Explicit
    Sub testme02()

    Dim myPicNames As Variant
    Dim myPict As Picture
    Dim myAddresses As Variant
    Dim myRng As Range
    Dim iCtr As Long

    myPicNames = Array("c:\pict1.jpg", _
    "C:\pict2.jpg")

    myAddresses = Array("a1:c3", "e1:g3")

    If UBound(myPicNames) <> UBound(myAddresses) Then
    MsgBox "design error"
    Exit Sub
    End If

    With Worksheets("sheet1")
    For iCtr = LBound(myPicNames) To UBound(myPicNames)
    Set myRng = .Range(myAddresses(iCtr))
    Set myPict = .Pictures.Insert(myPicNames(iCtr))
    myPict.Top = myRng.Top
    myPict.Width = myRng.Width
    myPict.Height = myRng.Height
    myPict.Left = myRng.Left
    myPict.Placement = xlMoveAndSize
    Next iCtr
    End With
    End Sub


    Shatin wrote:
    >
    > I use following lines to import two pictures into a worksheet:
    >
    > With ActiveSheet.Pictures
    > .Insert ("http://www.abc.com/picture1.jpg")
    > .Insert ("http://www.abc.com/picture2.jpg")
    > End With
    >
    > Both pictures are too big; also the placement of the pictures is rather
    > haphazard.
    >
    > Would appreciate it if someone could me how to:
    >
    > - place picture1 somewhere near to cell A1 and picture2 near to cell A20.
    > - resize height of picture1 to 3 inches
    > - resize width of picture2 to 4 inches
    >
    > TIA.


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1