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
Variable
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
What happens?this doesn´t work.
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!
Bob
A humble man and PROUD of it!
-
- Macro Veteran
- Posts: 247
- Joined: Fri Apr 15, 2005 8:32 am
Re: Variable
I think you need to have:Conrad wrote:Press CTRL
Send c
Release CTRL
Send>c
Though more info about why it's not working wouldn't hurt.
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&
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]
[email protected]