I am now able to export the value to Excel into cell A1. How can I loop the script below continuesly and record the value into a new cell each time? (In the same column)
I used a VERY SIMPLE notepad example:
CODE$Init = TimerInit()
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('notepad.exe')
WinWait("Untitled - Notepad","")
If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")
WinWaitActive("Untitled - Notepad","")
Send("hello{ENTER}{ENTER}{ENTER}this{SPACE}{ENTER}{ENTER}is{ENTER}{ENTER}a{SPACE}{SPACE}test{ENTER}{E
NTER}{ALTDOWN}e{ALTUP}f")
WinWait("Find","")
If Not WinActive("Find","") Then WinActivate("Find","")
WinWaitActive("Find","")
Send("c")
MouseMove(339,80)
MouseDown("left")
MouseUp("left")
WinWait("Untitled - Notepad","")
If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")
WinWaitActive("Untitled - Notepad","")
Send("{ALTDOWN}f{ALTUP}x")
WinWait("Notepad","")
If Not WinActive("Notepad","") Then WinActivate("Notepad","")
WinWaitActive("Notepad","")
Send("n")
Sleep(2000);2 seconds
$Seconds = Round(TimerDiff($Init)/1000, 2)
MsgBox(0, "Time", $Seconds)
#include <ExcelCOM_UDF.au3>
Local $oExcel = _ExcelBookNew() ;Create new book, make it visible
;Declare the Array
Local $aArray =
;_ExcelWriteArray($oExcel, 1, 1, $aArray) ; Write the Array Horizontally
_ExcelWriteArray($oExcel, 1, 1, $aArray, 1) ; Write the Array Vertically, starting on the 5th Row
MsgBox (0, "Exiting", "Press OK to Save File and Exit")
_ExcelBookSaveAs($oExcel, "c:\Temp.xls", "xls", 0, 1) ; Now we save it into the temp directory; overwrite existing file if necessary
_ExcelBookClose($oExcel) ; And finally we close out
Also tried doing it this way:
CODE$Init = TimerInit()
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('notepad.exe')
WinWait("Untitled - Notepad","")
If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")
WinWaitActive("Untitled - Notepad","")
Send("hello{ENTER}{ENTER}{ENTER}this{SPACE}{ENTER}{ENTER}is{ENTER}{ENTER}a{SPACE}{SPACE}test{ENTER}{E
NTER}{ALTDOWN}e{ALTUP}f")
WinWait("Find","")
If Not WinActive("Find","") Then WinActivate("Find","")
WinWaitActive("Find","")
Send("c")
MouseMove(339,80)
MouseDown("left")
MouseUp("left")
WinWait("Untitled - Notepad","")
If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")
WinWaitActive("Untitled - Notepad","")
Send("{ALTDOWN}f{ALTUP}x")
WinWait("Notepad","")
If Not WinActive("Notepad","") Then WinActivate("Notepad","")
WinWaitActive("Notepad","")
Send("n")
Sleep(2000);2 seconds
$Seconds = Round(TimerDiff($Init)/1000, 2)
MsgBox(0, "Time", $Seconds)
#include <ExcelCOM_UDF.au3> ; Include the collection
; Open new book, make it visible
Local $oExcel = _ExcelBookNew(1)
; Write a message to the first cell of the first sheet
_ExcelWriteCell($oExcel, $Seconds, "A1")
; Now we save it into the temp directory; overwrite existing file if necessary
_ExcelBookSaveAs($oExcel, "c:\temp.xls", "xls", 0, 1)
; And finally we close out
_ExcelBookClose($oExcel)