Miyahn
Fri Mar 11 19:08:03 CST 2005
"PO" wrote in message news:epstyYpJFHA.3376@TK2MSFTNGP14.phx.gbl
> The page is downloaded from our company webserver.
Try this.
Copy all images from a web page by Excel-VBA.
Sub Test()
GetImgs "
http://www.officetanaka.net/" ' example url
End Sub
'
Sub GetImgs(URL)
Dim aImg, Imgs, VPos: VPos = 10
With CreateObject("InternetExplorer.Application")
.Navigate URL
Do While .Busy: DoEvents: Loop
Set Imgs = .Document.Body.getElementsByTagName("IMG")
End With
Application.ScreenUpdating = False
With CreateObject("Scripting.Dictionary")
For Each aImg In Imgs
If Not .Exists(aImg.Src) Then
.Add aImg.Src, ""
With ActiveSheet.Pictures.Insert(aImg.Src)
.Top = VPos: .Left = 60: VPos = VPos + .Height + 5
End With
End If
Next
End With
Application.ScreenUpdating = True
End Sub
--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)
HQF03250@nifty.ne.jp