How to get images to appear in Excel given image url

核能气质少年 提交于 2019-11-26 12:25:28

问题


I\'m creating a csv file with one of the columns containing an url of an image (e.g., www.myDomain.com/myImage.jpg).
How I can get Excel to render this image?


回答1:


Dim url_column As Range
Dim image_column As Range

Set url_column = Worksheets(1).UsedRange.Columns("A")
Set image_column = Worksheets(1).UsedRange.Columns("B")

Dim i As Long
For i = 1 To url_column.Cells.Count

  With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
  End With

Next



回答2:


On Google Sheets you can add the IMAGE(url) method to your CSV file and it will be rendered (Tested on Google Sheets).

Here is an example:

=IMAGE("http://efdreams.com/data_images/dreams/lion/lion-03.jpg")


来源:https://stackoverflow.com/questions/6312710/how-to-get-images-to-appear-in-excel-given-image-url

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