答案 0 :(得分:1)
假设您的图片网址示例非常接近您真正想要的,您可以通过一些“网页抓取”来实现:
首先,您必须添加以下两个引用
Sub extract()
Dim IE As InternetExplorer
Dim html As HTMLDocument
Set IE = New InternetExplorerMedium
IE.Visible = False
IE.Navigate2 "https://www.google.com/images/srpr/logo11w.png"
' Wait while IE loading
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set html = IE.document
Dim webImage As Variant
Set webImage = html.getElementsByTagName("img")
'Debug.Print webImage(0).Width
'Debug.Print webImage(0).Height
MsgBox ("Image is " & webImage(0).Width & " x " & webImage(0).Height)
'Cleanup
IE.Quit
Set IE = Nothing
End Sub
结果: