|
各位老师好!
标红处出现弹窗,代码如下,请老师帮忙看一下在代码里直接更改
Sub 生产状态暂停()
Dim hwnd&, s%, AllWndText$, fhwnd&
''1.定义对象IE,定义计时器
Dim StartTime As Single
StartTime = Timer
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
IE.Visible = True
''2.浏览MES主页,输入账号密码后登入
IE.Navigate "http://mesweb-3/mes/"
While IE.ReadyState <> 4 Or IE.busy
DoEvents
Wend
IE.Document.all("loginName").Value = Sheet1.Range("H2").Value
IE.Document.all("loginPassword").Value = Sheet1.Range("I2").Value
IE.Document.getElementById("loginButton").Click
While IE.ReadyState <> 4 Or IE.busy
DoEvents
Wend
''3.进入MES批次查询界面
IE.Navigate "http://mesweb-3/mes/Sales/Settings/Lot.aspx"
While IE.ReadyState <> 4 Or IE.busy
DoEvents
Wend
''4.将工作表1的第一个批号输入进行查询
Dim i As Integer
i = 0
Do Until Sheet1.Range("A2").Offset(i, 0).Value = ""
IE.Document.all("LotSearchModule1_LotNoText").Value = Sheet1.Range("A2").Offset(i, 0).Value
IE.Document.getElementById("LotSearchModule1_OKButton").Click
While IE.ReadyState <> 4 Or IE.busy
DoEvents
Wend
''5.点击暂停生产
IE.Document.getElementById("pauselink").Click
While IE.ReadyState <> 4 Or IE.busy
DoEvents
Wend
''此处出现"来自网页的消息"弹窗",须进行确定
Loop
i = i + 1
End Sub
|
|