//选定并打开指定的EXCLE文件
MessageBox "请通过附件画图等软件确定各输入点点击点的坐标,使用TAB键进行下一条记录"
path=Plugin.File.SelectFile()
Delay 500
Call Plugin.lxj_Office.lxj_ExcelOpen(path,1)
//输入单元格所在的列
lie1 = clng(InputBox("第一输入单元格所在的列", "单元格所在的列", "2"))
lie2 = clng(InputBox("第二输入单元格所在的列", "单元格所在的列"))
i = clng(InputBox("开始的行", "从哪一行开始", "2"))
text = Plugin.lxj_Office.lxj_ExcelRead(1, i, lie1)
text1 = Plugin.lxj_Office.lxj_ExcelRead(1, i, lie2)
UserVar zuobiao1="0,0" "第一输入点"
UserVar zuobiao2="0,0" "第一点击点"
UserVar zuobiao3="0,0" "第二点击点"
UserVar zuobiao4= "0,0" "第二输入点"
zb1Array = Split(zuobiao1, ",")
zb2Array = Split(zuobiao2, ",")
zb3Array = Split(zuobiao3, ",")
zb4Array = Split(zuobiao4, ",")
t = 0
Delay 300
Rem ganghuo
//读取指定单元格的内容
If len(text) = 0 Then
t = t + 1
If t = 2 Then
Call Plugin.lxj_Office.lxj_ExcelSave()
Delay 1000
Call Plugin.lxj_Office.lxj_ExcelClose()
Delay 500
ExitScript
Else
MessageBox "已经读取到最后一条记录啦!"
End If
End If
Call Plugin.Sys.SetCLB(text)
//等待进行粘贴
If key = 27 Then
Key=99
text = Plugin.lxj_Office.lxj_ExcelRead(1, i, lie1)
text1 = Plugin.lxj_Office.lxj_ExcelRead(1, i, lie2)
Call Plugin.Sys.SetCLB(text)
Call Plugin.Msg.Tips("正在处理第" & i & "行")
Else
Delay 1000
Goto checkkey
End If
//第一输入点
MoveTo zb1Array(0), zb1Array(1)
LeftClick 3
delay 300
KeyDown 17, 1
KeyPress 86, 1
KeyUp 17, 1
i = i + 1
Delay 1000
GetColor=GetPixelColor(zb2Array(0), zb2Array(1))
If len(text1) <> 0 Then
Goto csf
Else
Goto cdf
End If
Rem cdf
//点击第一点击点
MoveTo zb2Array(0), zb2Array(1)
Delay 500
LeftClick 1
Delay 500
Rem dengdeng
Delay 500
GetColor1=GetPixelColor(zb2Array(0), zb2Array(1))
If GetColor1<>GetColor Then
Goto dengdeng
End If
//点击第二点击点
MoveTo zb3Array(0), zb3Array(1)
Delay 100
LeftClick 1
//进行一条读取
Goto checkkey
Rem csf
//第二输入点
Call Plugin.Sys.SetCLB("")
Call Plugin.Sys.SetCLB(text1)
MoveTo zb4Array(0), zb4Array(1)
LeftClick 3
delay 300
KeyDown 17, 1
KeyPress 86, 1
KeyUp 17, 1
//点击第一点击点
MoveTo zb2Array(0), zb2Array(1)
Delay 500
LeftClick 1
Delay 500
Rem dengdeng1
Delay 500
GetColor1=GetPixelColor(zb2Array(0), zb2Array(1))
If GetColor1<> GetColor Then
Goto dengdeng1
End If
//点击第二点击点
MoveTo zb3Array(0), zb3Array(1)
Delay 100
LeftClick 1
Call Plugin.Sys.SetCLB("")
//按键判断
Rem checkkey
key = GetLastKey
Goto ganghuo
Sub OnScriptExit()
Call Plugin.lxj_Office.lxj_ExcelSave()
Delay 1000
Call Plugin.lxj_Office.lxj_ExcelClose()
Delay 500
pName = "excel.exe"
VBSBegin
strComputer = "."
pName = "Select * from Win32_Process Where Name = '"&pName&"'"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" &strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery (pName)
For Each objProcess in colProcessList
objProcess.Terminate()
Next
VBSEnd
End Sub