Variable

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Conrad
Newbie
Posts: 1
Joined: Fri Jun 24, 2005 10:10 am

Variable

Post by Conrad » Fri Jun 24, 2005 10:15 am

Would be happy if someone could tell me why this doesn´t work.
I have a name in cell A1 in Excel and want to copy this name,
assaign it to a variabe and print it in cell B1



SetFocus>Microsoft Excel - 2005 304218Bokföringsorder.xls
Press CTRL
Send c
Release CTRL
GetClipboard>Name
Wait>2
Press Tab
Send Character/Text>Name

Conrad

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Jun 24, 2005 1:03 pm

this doesn´t work.
What happens?
What does not happen?
Does cursor move between cells?
Any messages in status line or any pop up messages?

Script looks good.

Diagnosis questions?
Did you Remove Trailing Spaces?
Did focus really go to that Window name?
Is cursor properly set in A1?
Did you Single Step and look at Watch List to see value of %Name%?
Are either of the spreadsheet cells locked with security?
Is the spreadsheet locked to Read Only?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

fightcancer
Macro Veteran
Posts: 247
Joined: Fri Apr 15, 2005 8:32 am

Re: Variable

Post by fightcancer » Wed Aug 10, 2005 6:20 am

Conrad wrote:Press CTRL
Send c
Release CTRL
I think you need to have:
Send>c

Though more info about why it's not working wouldn't hurt. :D

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Aug 10, 2005 6:50 am

Here's a much easier way:

Once your script has opened the xls file in Excel do this:

DDERequest>Excel,yourxlfile.xls,R1C1,data,60
DDEPoke>Excel,yourxlfile.xls,R1C2,data

This simply takes the value in row 1, column 1 (cell A1) and then puts it into row 1, column 2 (cell B1).

See:
http://www.mjtnet.com/forum/viewtopic.php?t=1482&
MJT Net Support
[email protected]

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