栖息谷-管理人的网上家园

标题: AutoIt在财务工作中的应用 [打印本页]

作者: gadflyh    时间: 2011-6-3 15:43
标题: AutoIt在财务工作中的应用
本帖最后由 gadflyh 于 2011-6-3 15:45 编辑

AutoItS可以帮助我们自动录入凭证及基础数据的操作。
可以根据EXCEL中的顺序在凭证录入窗口录入凭证。
excel文件名为COGS-entry.csv
会计科目     金额       。。。。
16004060
-768.1
16104060
768.1
16000003
-7.24
16100003
7.24
16000029
9.32

原代码如下:
$file = FileOpen("COGS-entry.csv", 0)

While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    ;MsgBox(0, "Line read:", $line)
    $array = StringSplit($line, ',', 1)
;_ArrayDisplay( $array, "_ArrayToString() Test" )
WinWaitActive("windows")     ;此处改为你的凭证录入窗口名;可以用AUOIT的工具Au3Info.exe查看.
Send("{F5}")
$i = 0
While $i<$array[0]
    $i = $i + 1
send($array[$i])
Sleep(300)
send("{Tab}")
Sleep(300)
WEnd
WEnd
FileClose($file)





欢迎光临 栖息谷-管理人的网上家园 (http://bbs.21manager.com.cn/) Powered by Discuz! X3.2