|
楼主 |
发表于 2014-8-23 18:34
|
显示全部楼层
本帖最后由 NewZealand 于 2014-8-23 18:35 编辑
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Sub NFZM03批量下载原始网页()
Dim Maxrow, i
Dim savePath As String
Dim MyURL As String
Dim MyFileName As String
Dim MySheet As String
Dim tt As String
Dim strFile As String
MySheet = "2014"
Maxrow = Sheets(MySheet).Cells(65536, "F").End(xlUp).Row
For i = 2 To 20 'Maxrow '
If Sheets(MySheet).Cells(i, "F").Value <> "" And Sheets(MySheet).Cells(i, "A").Value = "" Then
MyFileName = Sheets(MySheet).Cells(i, "F").Value
strFile = ThisWorkbook.Path & "\原始网页\" & MyFileName
' If Dir(strFile) = "" Then
MyURL = Sheets(MySheet).Cells(i, "E").Value
URLDownloadToFile 0, MyURL, strFile, 0, 0
Sheets(MySheet).Cells(i, "A").Value = "★" End if
End If
Next i
End Sub
运行上面的代码下载到的是登录的页面,而不是源网页,求救
|
|