Donnovan Posted June 9, 2011 Posted June 9, 2011 (edited) Hí! I want to show in a MsgBox a value i get form a cell in Excel. I start AutoIt with the Excel cursor in this cell. The code bellow do not work because the message box show a null valor: Dim $answer = 0 ClipPut("") WinActivate("[CLASS:XLMAIN]") send("^c") $answer = MsgBox(1,"",Clipget()) If i add a Sleep, it works, the MsgBox show the cell value: Dim $answer = 0 ClipPut("") WinActivate("[CLASS:XLMAIN]") send("^c") Sleep(30) $answer = MsgBox(1,"",Clipget()) The "^c" command take some time to conclude, and in parallel the Autoit code continues running, causing severe problems on my script. There is any way to copy values other than "Send("^c")" and then "Sleep(30)"? A way that stop the code until the value get copyed? Thankyou! Edited June 9, 2011 by Donnovan
MrMitchell Posted June 9, 2011 Posted June 9, 2011 Look up Excel Management in the AutoIt Help File. To get you started, you can use _ExcelBookOpen() or _ExcelBookAttach() then _ExcelReadCell(). Suggest you read up on it a bit before digging in!
Donnovan Posted June 14, 2011 Author Posted June 14, 2011 Thanks a lot! _IE... and _Excel... functions made a 1000% upgrade on my code!!! Faster, No Syncronism errors, and i can work while the script runs!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now