Hello All,
I have created a script to import picture from the website with the URL at cell Sheet1 B3 as below. Kindly anyone help me on how can I clear/delete the past picture when I run the macro on the subsequent run. I would also like to refreshes the picture whenever I open up the excel file. Your help will be very much appreciated.
Sub GetPicture()
Dim URL As String
PictureURL = Worksheets("Sheet1").Range("B3").Value
With ActiveSheet.Range("B4:F27")
Set MyPict = ActiveSheet.Pictures.Insert(PictureURL)
MyPict.Top = .Top
MyPict.Left = .Left
MyPict.Width = .Width
MyPict.Height = .Height
MyPict.Placement = xlMoveAndSize
End With
End Sub
I have created a script to import picture from the website with the URL at cell Sheet1 B3 as below. Kindly anyone help me on how can I clear/delete the past picture when I run the macro on the subsequent run. I would also like to refreshes the picture whenever I open up the excel file. Your help will be very much appreciated.
Sub GetPicture()
Dim URL As String
PictureURL = Worksheets("Sheet1").Range("B3").Value
With ActiveSheet.Range("B4:F27")
Set MyPict = ActiveSheet.Pictures.Insert(PictureURL)
MyPict.Top = .Top
MyPict.Left = .Left
MyPict.Width = .Width
MyPict.Height = .Height
MyPict.Placement = xlMoveAndSize
End With
End Sub