Sign in to follow this  
Followers 0
Donnovan

Problems with send("^c")

3 posts in this topic

#1 ·  Posted (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 by Donnovan

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0