|
怎么样不显示excel窗口就能复制表格里的内容
#include <Excel.au3>
#include <GUIConstantsEx.au3>
GUICreate("小区超级密码查找",400,400)
$a=GUICtrlCreateButton("确认按钮",180,90,60,30)
$b=GUICtrlCreateInput("",100,30,280,20)
GUICtrlCreateLabel("请输入小区地址",5,30,90,20)
$c=GUICtrlCreateInput("",100,60,280,20)
GUICtrlCreateLabel("请输入ip地址",5,60,90,20)
GUISetState(@SW_SHOW)
Func serach()
$sFilePath1 = "E:\1.xls"
$oExcel = _excelbookopen($sFilePath1,1) _excelbookopen($sFilePath1,0) 就不显示了
for $i=1 to 200 step 1
$d=_excelreadcell($oExcel,$i,1)
$e=_excelreadcell($oExcel,$i,2)
$f=_excelreadcell($oExcel,$i,3)
if GUICtrlRead($b)=$d then
_ExcelBookClose($oExcel)
sleep(1000)
run("telnet " & GUICtrlRead($c))
WinActivate("Telnet","")
sleep(100)
send($e & "{enter}")
send($f & "{enter}")
exitloop
Else
EndIf
Next
if GUICtrlRead($b)<>$d Then
_ExcelBookClose($oExcel)
MsgBox(0,"找不到","不存在")
endif
_ExcelBookClose($oExcel)
endfunc
func portbutton()
send( "{down 2}")
sleep(100)
send("{space }")
sleep(100)
send("{space }")
sleep(100)
send("{space }")
sleep(100)
send("{space }")
sleep(100)
send("{down}")
sleep(100)
send("{enter}")
sleep(100)
send("{Esc}")
sleep(100)
send("{Esc}")
sleep(100)
send("{Esc}")
sleep(100)
send("{up 3}")
sleep(100)
send("{enter}")
sleep(5000)
send("{enter}")
sleep(2000)
send("{down}")
sleep(100)
send("{down}")
sleep(100)
send("{enter}")
EndFunc
while 1
$msg=GUIGetMsg()
Select
case $msg=$GUI_EVENT_CLOSE
exit
case $msg=$a
serach()
EndSelect
WEnd
[ 本帖最后由 bin0131 于 2009-2-10 20:06 编辑 ] |
|