|
楼主 |
发表于 2022-7-30 15:44
|
显示全部楼层
Option Explicit
Sub IE()
Dim arrBM, arrZKZ, arrSFZ, cnt As Long
arrBM = Range("C2:C" & Range("C" & Rows.Count).End(xlUp).Row)
arrZKZ = Range("D2:D" & Range("D" & Rows.Count).End(xlUp).Row)
arrSFZ = Range("E2:E" & Range("E" & Rows.Count).End(xlUp).Row)
Dim IE As Object, link As String
Set IE = CreateObject("InternetExplorer.Application")
link = "http://cx.sceea.cn/html/GKCJ.htm"
With IE
.Visible = True
.navigate link
IEWait IE
For cnt = 1 To UBound(arrBM)
.document.getelementbyid("ksh").Value = arrBM(cnt, 1)
.document.getelementbyid("zkzh").Value = arrZKZ(cnt, 1)
.document.getelementbyid("sfzh").Value = arrSFZ(cnt, 1)
.document.getelementbyid("kbq").Click
Do
Application.Wait Now + TimeValue("00:00:01")
Loop While .document.getelementbyid("ksh").Value <> ""
Next cnt
End With
IE.Quit: Set IE = Nothing
End Sub
Function IEWait(ByRef objIE As Object)
Do While objIE.Busy = True Or objIE.readyState <> 4
DoEvents
Loop
End Function |
|