20231012_按键精灵练习_excel表数据循环写入网页窗口

按键精灵练习_excel表数据循环写入网页窗口

// D:\小信发起存储\BOMC工单数据.xlsx

//定义行号、列号
hang = 2
lie = 3

Rem excel表循环
//----打开 xlsx 读取内容
Call Plugin.Office.OpenXls("D:\小信发起存储\BOMC工单数据.xlsx")
//----延时
Delay 200
biaoti = "q" & Plugin.Office.ReadXls(1, hang, lie)
neirong = Plugin.Office.ReadXls(1, hang, lie + 1)

//保存数据再打开一次
Call Plugin.Office.CloseXls()
    
If biaoti <> "" Then 
    //显示内容
    //MessageBox "流水号:" & hang & "-" & lie & " 工单数据:" & biaoti
    
    //可以在这里加入申告发起
    Goto 小信发起
    //具体操作
    Rem 小信结束
    
    hang = hang + 1
    //跳转回 读取数据 读取下一个工号
    Goto excel表循环
    
Else 
    //获取当前电脑时间
    in_timei = Plugin.Sys.GetDateTime()
    //----打开 xlsx 读取内容
    Call Plugin.Office.OpenXls("D:\小信发起存储\BOMC工单数据.xlsx")
    //执行完成写入执行时间
    Call Plugin.Office.WriteXls(1, hang, lie - 1, in_timei)
    MessageBox "流水号:" & hang & "-" & lie & " 工单完成:" & in_timei
End If

//小信处理模块
Rem 小信发起

//鼠标挪动到我要报障位置
FindPic 0, 0, 1920, 1080, "D:\小信发起存储\我要报障.bmp", 0.95, int_a1, int_b1
//MessageBox "我要报障:" & int_a1 &"-"& int_b1
Delay 200
If int_a1 > 0 and int_b1 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a1 + 5, int_b1 + 5
    LeftClick 1
    //解除鼠标
    UnlockMouse
End If

Delay 300

//鼠标挪动到确定按钮位置
FindPic 0, 0, 1920, 1080, "D:\小信发起存储\确定按钮.bmp", 0.95, int_a2, int_b2
//MessageBox "确定按钮:" & int_a2 &"-"& int_b2
Delay 200
If int_a2 > 0 and int_b2 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a2 + 5, int_b2 + 5
    LeftClick 1
    //解除鼠标
    UnlockMouse
End If

Delay 2000

//鼠标滚轮向下,显示报障工单菜单
MouseWheel - 2 
Delay 300
FindPic 0, 0, 1920, 1080, "D:\小信发起存储\报障标题.bmp", 0.95, int_a3, int_b3
//MessageBox "报障标题:" & int_a3 &"-"& int_b3
Delay 200
If int_a3 > 0 and int_b3 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a3 + 115, int_b3 + 5
    LeftClick 1
    Delay 200
    //输入标题文字
    SayString biaoti
    Delay 4000
    //解除鼠标
    UnlockMouse
End If

Delay 2000

FindPic 0, 0, 1920, 1080, "D:\小信发起存储\问题内容.bmp", 0.95, int_a6, int_b6
//MessageBox "问题内容:" & int_a6 &"-"& int_b6
Delay 200
If int_a6 > 0 and int_b6 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a6 + 115, int_b6 + 5
    LeftClick 1
    Delay 200
    //输入标题文字
    SayString neirong
    Delay 2000
    //解除鼠标
    UnlockMouse
End If

Delay 2000

FindPic 0, 0, 1920, 1080, "D:\小信发起存储\一级分类.bmp", 0.99, int_a4, int_b4
//MessageBox "一级分类:" & int_a4 &"-"& int_b4
Delay 200
If int_a4 > 0 and int_b4 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a4 + 115, int_b4 + 5
    LeftClick 1
    Delay 200
    KeyPress "Down", 1
    Delay 200
    KeyPress "Enter", 1
    Delay 200
    //解除鼠标
    UnlockMouse
End If

Delay 2000

FindPic 0, 0, 1920, 1080, "D:\小信发起存储\二级分类.bmp", 0.99, int_a5, int_b5
//MessageBox "二级分类:" & int_a5 &"-"& int_b5
Delay 200
If int_a5 > 0 and int_b5 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a5 + 115, int_b5 + 5
    LeftClick 1
    Delay 200
    KeyPress "Down", 1
    Delay 200
    KeyPress "Enter", 1
    Delay 200
    //解除鼠标
    UnlockMouse
End If

Delay 2000

FindPic 0, 0, 1920, 1080, "D:\小信发起存储\提交按钮.bmp", 0.95, int_a7, int_b7
//MessageBox "提交按钮:" & int_a7 &"-"& int_b7
Delay 200
If int_a7 > 0 and int_b7 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a7 + 5, int_b7 + 5
    LeftClick 1
    //解除鼠标
    UnlockMouse
    Delay 8000
End If

Delay 2000

FindPic 0, 0, 1920, 1080, "D:\小信发起存储\清空聊天记录.bmp", 0.95, int_a8, int_b8
//MessageBox "清空聊天记录:" & int_a8 &"-"& int_b8
Delay 200
If int_a8 > 0 and int_b8 > 0 Then 
    //锁定鼠标
    LockMouse
    MoveTo int_a8 + 5, int_b8 + 5
    LeftClick 1
    Delay 2000
    //解除鼠标
    UnlockMouse
End If

Goto 小信结束

你可能感兴趣的:(按键精灵,excel)