none
Display image from internet on my form (Excel macros VBA) RRS feed

  • Question

  • I want to show web images on my form.

    This is what I've tried:

    =========

    1. I make a shape and then fill with the image I want. And it works: bring me the image on the active sheet. But, I do not know what to call this picture from my form.

    Exercise1Sub()
         ActiveSheet.Shapes.AddShapemsoShapeRectangle, 50,50, 100, 100
         ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Fill.UserPicture"http://url.jpg"
    End Sub

    =========

    2. Similar, but adding the image as a shape. And this also works: the image is downloaded to the active sheet. But I do not know how to take it on my form.

    Exercise2Sub()
         Web_url="http://url.jpg"
         SetmyDocument=Worksheets (1)
         SetMy_Image=myDocument.Shapes.AddPicture(Web_url,True,True, 100,100, 90, 90)
    End Sub
    =========

    Any ideas to help me, either a) downloading the image directly on the form, or b) using the image I already have in the sheet on the form? Thanks.

    Wednesday, July 9, 2014 1:44 AM