找回密码
 加入
搜索
查看: 1346|回复: 1

怎么样不显示excel窗口就能复制表格里的内容

[复制链接]
发表于 2009-2-10 19:54:15 | 显示全部楼层 |阅读模式
怎么样不显示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 编辑 ]
发表于 2009-2-10 21:34:57 | 显示全部楼层
_ExcelBookOpen第二个参数啊
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 20:28 , Processed in 0.072382 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表