How to insert a picture from the internet into VBA Excel Userform

痞子三分冷 提交于 2019-12-25 06:49:46

问题


I found some VB code here, but I need it for VBA. After reading this code I tried messing around with this code, but still trying to figure it out. Also, someone else had this problem before as shown here, but there was no explicit solution.

The code I am working with:

Sub Image1Insert()
    Application.ScreenUpdating = False
    Dim strPath As String
    strPath = "https://www.gravatar.com/avatar/fbd7dcb2d47ddcd7e6a799bde3ec0ef6?s=48&d=identicon&r=PG&f=1"
    UserForm1.Image1.Picture = LoadPicture(strPath)
End Sub

UserForm1.Image1.Picture = LoadPicture(strPath)

or UserForm1.Image1.Picture = ActiveSheet.Pictures.Insert(strPath)

Neither work, but it is the idea. Thanks in advance!

来源:https://stackoverflow.com/questions/36271981/how-to-insert-a-picture-from-the-internet-into-vba-excel-userform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!