如何下载单元格中的多个链接?

我怎样才能从一个单元格分隔的图像下载; 字符?

这是一个示例单元格(A2):

 https://lh6.ggpht.com/uxLXvxuncWOm2mgU3ChtdGZ0eMp_WJTD4xrVxAKqCJMiR5ibaBbw-VUPJPjcGiqIDRbm=h310; https://lh3.ggpht.com/N7B7AVDDD0577crgHxHHo15uCkjSr3oimEwZWhF-VVxNYhRMIHd2eoI14WfuTHfMmtNC=h310; https://lh6.ggpht.com/c_pfo3A3fQh40udcyhdgGIVsBa_GB9A09O642Vlwi6ka4fqwyT9044pzU-jF_rjb4VX_=h310; https://lh5.ggpht.com/KqUgPKrZYuVa_AAOLtR0URf_8pJ_lX6au7UH2pcHzs7G3eLL9Vt7hAk83JgkqVMBIQ=h310; https://lh6.ggpht.com/uxLXvxuncWOm2mgU3ChtdGZ0eMp_WJTD4xrVxAKqCJMiR5ibaBbw-VUPJPjcGiqIDRbm=h900; https://lh3.ggpht.com/N7B7AVDDD0577crgHxHHo15uCkjSr3oimEwZWhF-VVxNYhRMIHd2eoI14WfuTHfMmtNC=h900; https://lh6.ggpht.com/c_pfo3A3fQh40udcyhdgGIVsBa_GB9A09O642Vlwi6ka4fqwyT9044pzU-jF_rjb4VX_=h900; https://lh5.ggpht.com/KqUgPKrZYuVa_AAOLtR0URf_8pJ_lX6au7UH2pcHzs7G3eLL9Vt7hAk83JgkqVMBIQ=h900 

A列中包含如此多的单元格,其中包含像这样的图像链接。
如何将这些图像保存到本地文件夹?

如果图像重命名为其URL,例如:单元格A2中的第一个图像:

 uxLXvxuncWOm2mgU3ChtdGZ0eMp_WJTD4xrVxAKqCJMiR5ibaBbw-VUPJPjcGiqIDRbm.png 

我testing过这个VBA脚本:

 Sub Save_image() Dim oHTTP As Object Dim sDestFolder As String Dim sSrcUrl As String Dim sImageFile As String sDestFolder = "C:\Users\adale\Desktop\Compendium Images\" sSrcUrl = ActiveCell.Value If Left(sSrcUrl, 2) = "//" Then sSrcUrl = "https:" & sSrcUrl End If sImageFile = Right(ActiveCell.Value, Len(ActiveCell.Value) - InStrRev(ActiveCell.Value, "/")) Debug.Print sImageFile ActiveCell.Offset(0, 2).Value = sImageFile Set oHTTP = CreateObject("msxml2.XMLHTTP") oHTTP.Open "GET", sSrcUrl, False oHTTP.send Set oStream = CreateObject("ADODB.Stream") Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 oStream.Type = adTypeBinary oStream.Open oStream.write oHTTP.responseBody oStream.savetofile sDestFolder & sImageFile, adSaveCreateOverWrite Set oStream = Nothing Set oHTTP = Nothing End Sub 

但是它会在这一行中返回一个错误:

 oHTTP.Open "GET", sSrcUrl, False 

使用Split()方法并使用; 作为分隔符,然后使用For Each循环为每个URL运行一段代码:

 '// Create single dimension array of image URLs myImages = Split(ActiveCell.Value, ";") For Each img In myImages '// Do whatever you want with each image URL here... '// If there are spaces inbetween then perhaps use Trim(img) Next '// Rest of code...