vb 自动填写网页内容 出现 91,WITH 块变量未设置
目标:把EXCEL 中的 药品监管码提交到http://www1.,并提取条形码的药品名称,规格,生产厂家,批号,有效期,批准文号等信息以下面四个为例
81256200007436720261
81362180000567732475
81320280009831826807
81011570092686473901
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.Navigate "http://email.
timeie = DateAdd("s", 10, Now())
Do While ie.Busy And Not ie.readyState = READYSTATE_COMPLETE
DoEvents
If timeie < Now() Then
MsgBox "无法连接网站,请重新执行"
ie.Quit
Exit Sub
End If
Loop
ie.document.getElementById("pwdInput").Value = "xxxx"
ie.document.getElementById("userNameIpt").Value = "xxxxxx"
ie.document.getElementById("btnSubmit").Click
Set ie = Nothing
我叉,这段代码登录163没有问题,奇怪的是登录监管网马上出错
Sub t()
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.Navigate "http://www1.
timeie = DateAdd("s", 10, Now())
Do While ie.Busy And Not ie.readyState = READYSTATE_COMPLETE
DoEvents
If timeie < Now() Then
MsgBox "无法连接网站,请重新执行"
ie.Quit
Exit Sub
End If
Loop
ie.document.getElementById("piatscode1").Value = "8125"
ie.document.getElementById("piatscode2").Value = "1025"
' ie.document.getElementById("btnSubmit").Click
Set ie = Nothing
End Sub
两者没什么差别,我只修改下ID,就出现 WITH 对象错误
所以 我百思不得骑姐
以上我是用VBA编的,若用VB编写也是一样,谢谢老师们指点