在VBA中使用AUTOIT

关于AUTOIT 介绍,请看这个帖子,这里不再重复
http://club.excelhome.net/viewth ... 0224&highlight=


本文主要介绍  AUTOIT 在  EXCEL vba 应用

请先自行安装AUTOIT,再看下面简单例子


Sub autoit()

Set x = CreateObject("AutoItX3.Control")

x.Run ("notepad.exe")
End Sub
 
Sub bb()
Set autoit = CreateObject("AutoItX3.Control")
autoit.Run ("notepad.exe")
autoit.WinWaitActive ("无标题")
  x = autoit.WinGetCaretPosX()
  y = autoit.WinGetCaretPosY()
Call autoit.MouseClick("right", x, y)
autoit.Send ("abcde1234")
autoit.Send ("{ENTER}")

End Sub







Sub bb()
Set autoit = CreateObject("AutoItX3.Control")
For I = 100 To 800
Call autoit.MouseMove(I, I)
Next
End Sub





Sub bb()
Set autoit = CreateObject("AutoItX3.Control")
Call autoit.ToolTip("hi★★欢迎使用我的软件★★★★")
End Sub