我用autoit3实现VBA操作通达信自动交易,
Sub Test1()
Dim oShell
Dim oAutoIt
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Initialise Variables & Objects
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set oAutoIt = createobject("AutoItX3.Control")
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Start of Script
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Call oAutoIt.ToolTip("hi★★欢迎使用我的软件★★★★")
call oAutoIt.Run("notepad.exe")
' Wait for the Notepad window to become active
oAutoIt.WinWaitActive "Untitled - Notepad", ""
' Send some keystokes to notepad
oAutoIt.Send "Hello, this is line 1{ENTER}"
oAutoIt.Send "This is line 2{ENTER}This is line 3"
oAutoIt.Sleep 1000
oAutoIt.Send "!{F4}"
oAutoIt.WinWaitActive "Notepad", "save the changes?"
oAutoIt.Send "!n"
oAutoIt.WinWaitClose "Untitled - Notepad", ""
Set oAutoIt=nothing
End Sub
但是用了这个代码,金字塔就卡死了,对应的OCX已经regsvr32,难道金字塔调用外部的DLL,有限制?EXCEL的VBA调用都正常
使用Application.msgout函数调试一下看一下是在那一行卡死的?
另外目前金字塔已经自己在研发外挂系统了,预计下个月中旬左右就会推出来。
我调试了一下,知道原因了,通过AUTOIT可以实现任何第三方的股票软件的自动化交易,金字塔的VBA很棒
如何用你的通达信自动交易?