Jump to content

Problems with send("^c")


Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...