SerenityNetworks
Board Regular
- Joined
- Aug 13, 2009
- Messages
- 131
- Office Version
- 365
- Platform
- Windows
I was using the code below to display in Column-B the image located at the URL in Column-A. I'll loop through the code to display in the worksheet thousands of images. The initial download will always take time, but just reopening the workbook at a later time is dismally slow when the images are located on the web.
I am not a coder, although I can tweak code once given an example. Would there be a way to modify the code below so that either:
Option 1 would be really nice, but if it isn't easily doable then Option 2 would work for me as well.
Thank you in advance,
Andrew
I am not a coder, although I can tweak code once given an example. Would there be a way to modify the code below so that either:
- The macro downloads the image file to a local directory (a named sub-directory where the Excel file is located) and then place the link path in one column and display the image in the next column? (So Column-A would contain the initial URL to the image file. Column-B would contain the path (URL) to the local file of the image. Column-C would display the image stored locally.
- Modify the code to simply place the actual image into the Excel file. (The images are 80 to 150k in size, so I'd just limit the number of URLs to keep the Excel file from becoming too large.)
Option 1 would be really nice, but if it isn't easily doable then Option 2 would work for me as well.
Thank you in advance,
Andrew
Code:
Sub Test()
Dim Pic As Picture
Application.ScreenUpdating = False
With ActiveSheet.Range("A1")
Set Pic = .Parent.Pictures.Insert(.Value)
With .Offset(, 1)
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = .Height
Pic.Width = .Width
End With
End With
Application.ScreenUpdating = True
End Sub
Last edited: