- 帖子
- 161
- 主題
- 26
- 精華
- 0
- 積分
- 187
- 點名
- 0
- 作業系統
- xp
- 軟體版本
- office 2010
- 閱讀權限
- 20
- 性別
- 男
- 來自
- TW
- 註冊時間
- 2011-1-2
- 最後登錄
- 2022-2-16
|
8#
發表於 2013-9-10 19:21
| 只看該作者
請問G大,是不是
.Pictures.Insert (.Cells(i, 2))
的問題
我註解了,就可執行
謝謝
Option Explicit
Sub 下載網路照片()
Dim a As Variant, e As Integer, i As Integer, s As Variant, p As Integer
With CreateObject("Microsoft.XMLHTTP")
.Open "get", "http://blog.mjjq.com/archives/1975.html", False
.send
a = Split(.responseText, vbLf)
End With
With ActiveSheet
.Pictures.Delete
.Cells.Clear
i = 1
For e = 0 To UBound(a)
If InStr(a(e), "src=""http://") And InStr(a(e), ".jpg"" /><br />") Then
s = Split(a(e), "alt=""")(1)
s = Split(s, """ width=""")(0)
.Cells(i, 1) = s
s = Split(a(e), "src=""")(1)
s = Split(s, """ /><br />")(0)
.Cells(i, 2) = s
p = .Pictures.Count
.Cells(1 + (p * 20), "H").Select
' .Pictures.Insert (.Cells(i, 2))
i = i + 1
End If
Next
End With
End Sub |
|