Copy value from Excel

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
spid
Newbie
Posts: 7
Joined: Fri Apr 01, 2005 9:46 am

Copy value from Excel

Post by spid » Tue Jun 07, 2005 8:00 pm

Hi,

I got the idea for the following from this forum, but I cannot get the value I want copied (in this case in Excel) out of the clipboard. What am I doing wrong?

// Use Excel GoTo command to go to Z1. Copy Z1 to clipboard as Value1
//Excel has focus
Press CTRL
Wait>1
Send>g
WaitWindowOpen>Microsoft Excel - *.xls
Wait>1
Release CTRL
Wait>1
Send>z1
Wait>1
Press Enter
Press CTRL
Send Character/Text>C
Release CTRL
WaitClipBoard>2
GetClipBoard>Value1
MessageModal,Value1

Any and all help will be appreciated.

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jun 07, 2005 8:41 pm

Press CTRL
Send>g
//WaitWindowOpen>Microsoft Excel - *.xls
//You said you already have it open
Release CTRL
//added the next wait and changed some of your others to suit my machine
//yours may be different
Wait>0.5
Send>z1
Wait>0.5
Press Enter
Wait>0.5
Press CTRL
//Send Character/Text>C
//Per Support, use lower case here
Send>c
Release CTRL
WaitClipBoard>2
GetClipBoard>Value1
//MessageModal,Value1
//Need a "greater than" symbol and percents around your variable.
MessageModal>%Value1%

Hope this helps,
Dick

spid
Newbie
Posts: 7
Joined: Fri Apr 01, 2005 9:46 am

Post by spid » Tue Jun 07, 2005 9:32 pm

Thanks!

I copied your changes verbatim. Macro runs, but then I get a msgbox containing this text: %value1%. Seems it is not getting the clipboard.

Ideas?

IGNORE ABOVE: added wait before and after CTRL and works fine.

THANKS!

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Fri Jun 10, 2005 10:10 pm

it is MUCH faster to use DDERequest>
it is explained in the help files.

DDERequest>Excel,yourfile.xls,RowColumn,yourVariable,HowLongToWait

very powerful

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts